Package: bash
Version: 4.1-3
Severity: minor

Hi,

I have a bit unusual context: as root create

# mkdir -p /foo/bar/baz

and set

# chmod go= /foo

then

# cd /foo/bar && su $user -c '/bin/bash --posix'

Now, as $user, who does not have permissions on /foo, but does on the current
directory /foo/bar and subdir baz, I run (and get the error):

$ cd baz
bash: cd: baz: Not a directory

Note that I _do_ expect an error message, but _not this one_. Instead e.g. dash
reports:

$ cd baz
cd: 1: can't cd to baz

It's maybe worth pointing out that this behaviour is only triggered when bash
runs in POSIX mode, and thus defaults to using logical pathname resolution
(option -L) as in the POSIX spec[1]. In non-POSIX mode, the 'cd baz' just
works (which initially seemed to me to be a discrepancy in either bash or
dash).

Best,
Jaap


[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cd.html


-- System Information:
Debian Release: 6.0.6
  APT prefers stable
  APT policy: (800, 'stable'), (500, 'stable-updates'), (199, 'testing')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/3 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages bash depends on:
ii  base-files                6.0squeeze6    Debian base system miscellaneous f
ii  dash                      0.5.5.1-7.4    POSIX-compliant shell
ii  debianutils               3.4            Miscellaneous utilities specific t
ii  libc6                     2.11.3-4       Embedded GNU C Library: Shared lib
ii  libncurses5               5.7+20100313-5 shared libraries for terminal hand

Versions of packages bash recommends:
ii  bash-completion               1:1.2-3    programmable completion for the ba

Versions of packages bash suggests:
pn  bash-doc                      <none>     (no description available)

-- Configuration Files:
/etc/bash.bashrc changed [not included]
/etc/bash_completion changed [not included]

-- no debconf information


----- End forwarded message -----


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to