misc/101316: /bin/sh pwd bug after cd into restricted directory

Aragon Gouveia aragon at phat.za.net
Thu Aug 3 12:00:38 UTC 2006


>Number:         101316
>Category:       misc
>Synopsis:       /bin/sh pwd bug after cd into restricted directory
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 03 12:00:34 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Aragon Gouveia
>Release:        6.1-RELEASE
>Organization:
>Environment:
FreeBSD <snip> 6.1-RELEASE-p3 FreeBSD 6.1-RELEASE-p3 #0: Fri Jul 14 15:05:23 UTC 2006     root@<snip>:/usr/src/sys/i386/compile/PAVLOV  i386
>Description:
After attempting (and failing) to cd into a directory whose permissions restrict that access, the $PWD and output of pwd reflect that I am in that directory.  But performing a file listing confirms that I am not.

>How-To-Repeat:
$ cd /var/db
$ ls -l
total 974
drwx------   2 operator  operator     512 Aug  3 11:44 entropy
drwx------   2 root      wheel        512 May  7 03:54 ipf
-r--r--r--   1 nobody    wheel     953165 Jul 29 04:15 locate.database
-rw-r--r--   1 root      wheel          0 Jul 12 09:10 mountdtab
-rw-r--r--   1 root      wheel          7 Aug  3 11:07 ntp.drift
drwxr-xr-x  35 root      wheel       1024 Jul 18 11:04 pkg
drwxr-xr-x   8 root      wheel        512 Jul 18 10:59 ports
drwxr-xr-x   2 root      wheel        512 May  7 03:54 portsnap
drwxr-xr-x  46 root      wheel       1024 Jul 14 09:21 sup
$ pwd
/var/db
$ cd ipf
cd: can't cd to ipf
$ pwd
/var/db/ipf
$ ls -l
total 974
drwx------   2 operator  operator     512 Aug  3 11:44 entropy
drwx------   2 root      wheel        512 May  7 03:54 ipf
-r--r--r--   1 nobody    wheel     953165 Jul 29 04:15 locate.database
-rw-r--r--   1 root      wheel          0 Jul 12 09:10 mountdtab
-rw-r--r--   1 root      wheel          7 Aug  3 11:07 ntp.drift
drwxr-xr-x  35 root      wheel       1024 Jul 18 11:04 pkg
drwxr-xr-x   8 root      wheel        512 Jul 18 10:59 ports
drwxr-xr-x   2 root      wheel        512 May  7 03:54 portsnap
drwxr-xr-x  46 root      wheel       1024 Jul 14 09:21 sup
$ cd ..
$ pwd
/var/db
$ ls -l
total 974
drwx------   2 operator  operator     512 Aug  3 11:44 entropy
drwx------   2 root      wheel        512 May  7 03:54 ipf
-r--r--r--   1 nobody    wheel     953165 Jul 29 04:15 locate.database
-rw-r--r--   1 root      wheel          0 Jul 12 09:10 mountdtab
-rw-r--r--   1 root      wheel          7 Aug  3 11:07 ntp.drift
drwxr-xr-x  35 root      wheel       1024 Jul 18 11:04 pkg
drwxr-xr-x   8 root      wheel        512 Jul 18 10:59 ports
drwxr-xr-x   2 root      wheel        512 May  7 03:54 portsnap
drwxr-xr-x  46 root      wheel       1024 Jul 14 09:21 sup

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list