Package: bash Version: 3.1dfsg-8 Severity: normal bash's builtin test function does not honor ACLs.
I have a test file which my user can read, but only because of the ACLs: [EMAIL PROTECTED]:~/Mail$ ls -l testdatei -rw-r-----+ 1 root root 0 2007-07-01 12:51 testdatei [EMAIL PROTECTED]:~/Mail$ getfacl testdatei # file: testdatei # owner: root # group: root user::rw- user:mitch:r-- group::--- mask::r-- other::--- But bash tells me that the file is not readable by me: [EMAIL PROTECTED]:~/Mail$ echo $SHELL /bin/bash [EMAIL PROTECTED]:~/Mail$ [ -r testdatei ] && echo readable || echo not readable not readable The external test command gives the correct result: [EMAIL PROTECTED]:~/Mail$ /usr/bin/test -r testdatei && echo readable || echo not readable readable strace shows that bash calls stat64() while /usr/bin/test calls access(): [EMAIL PROTECTED]:~/Mail$ strace -e access,stat64 bash -c '[ -r testdatei ]' access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) stat64("/home/mitch/Mail", {st_mode=S_IFDIR|0750, st_size=12288, ...}) = 0 stat64(".", {st_mode=S_IFDIR|0750, st_size=12288, ...}) = 0 stat64(".", {st_mode=S_IFDIR|0750, st_size=12288, ...}) = 0 stat64("/usr/local/bin/bash", 0xbfdc4018) = -1 ENOENT (No such file or directory) stat64("/usr/bin/bash", 0xbfdc4018) = -1 ENOENT (No such file or directory) stat64("/bin/bash", {st_mode=S_IFREG|0755, st_size=677184, ...}) = 0 stat64("/bin/bash", {st_mode=S_IFREG|0755, st_size=677184, ...}) = 0 stat64("testdatei", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0 Process 29804 detached [EMAIL PROTECTED]:~/Mail$ strace -e access,stat64 /usr/bin/test -r testdatei access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) access("testdatei", R_OK) = 0 Process 29727 detached The documentation of the builtin test does not mention file permissions, but explicitly states "if file is readable by you". As the file is indeed readable by me, this looks like a bug to me. [EMAIL PROTECTED]:~/Mail$ help test | grep -- -r -r FILE True if file is readable by you. Perhaps bash should use access() instead of stat64(). This might be related to bug #387408. References: de.comp.os.unix.linux.misc <[EMAIL PROTECTED]> et seq. Regards, Christian -- System Information: Debian Release: 4.0 APT prefers stable APT policy: (500, 'stable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.18 Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) Versions of packages bash depends on: ii base-files 4 Debian base system miscellaneous f ii debianutils 2.17 Miscellaneous utilities specific t ii libc6 2.3.6.ds1-13 GNU C Library: Shared libraries ii libncurses5 5.5-5 Shared libraries for terminal hand bash recommends no packages. -- no debconf information -- ....Christian.Garbs.....................................http://www.cgarbs.de Wer sich im Gefängnis nicht benimmt, fliegt raus.
signature.asc
Description: Digital signature