NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-i386/43639: sh allows user to source a directory



>Number:         43639
>Category:       port-i386
>Synopsis:       sh allows user to source a directory
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 18 17:35:00 +0000 2010
>Originator:     Billy Coutsis
>Release:        5.0.2
>Organization:
>Environment:
NetBSD tamper.bmc.local 5.0.2 NetBSD 5.0.2 (GENERIC) #0: Sat Feb  6 17:53:27 
UTC 2010  
builds%b7.netbsd.org@localhost:/home/builds/ab/netbsd-5-0-2-RELEASE/i386/201002061851Z-obj/home/builds/ab/netbsd-5-0-2-RELEASE/src/sys/arch/i386/compile/GENERIC
 i386
>Description:
sh seems to try and source the literal contents of a filesystem directory 
entry, instead of failing with an error.

I can't think of a sane reason why a user would want to do this. For 
comparison, bash on Linux fails with message "is a directory" and exit code 1.
>How-To-Repeat:
1) From a /bin/sh shell, try and source a directory, eg. ". /" or ". /usr"
2) Observe that the shell seems to try and source the literal contents of the 
filesystem directory entry.
>Fix:
Make the shell fail with an error when the user tries to do this. Of course, 
any fix should not conflict with any standard that sh should conform to.



Home | Main Index | Thread Index | Old Index