Package: dash
Version: 0.5.5.1-7.4
Severity: normal
While DASH properly reports that a *file* on a READONLY mount is not
writeable through its builtin 'test' function, it does not properly
detect that a *directory* is not writeable.
(filesystem type is not important, as this is true on NFS and EXT4
at least, and suspect it's fstype agnostic)
### filesystem is currently read-write
BASH:~# awk '$2=="/d2"{print $0}' /proc/mounts
/dev/sdd2 /d2 ext4
rw,nosuid,nodev,relatime,errors=remount-ro,barrier=1,journal_checksum,nodelalloc,data=journal
0 0
### remount filesystem read-only
BASH:~# mount -o remount,ro /d2
### See that 'bash' performs as expected...
### confirm filesystem is now read-only
BASH:~# awk '$2=="/d2"{print $0}' /proc/mounts
/dev/sdd2 /d2 ext4
ro,nosuid,nodev,relatime,errors=remount-ro,barrier=1,journal_checksum,nodelalloc,data=journal
0 0
### attempt to touch a file to confirm
BASH:~# touch /d2/foompy
touch: cannot touch `/d2/foompy': Read-only file system
### use our builtin command 'test' (as [) to confirm
### expected behaviour that files and directories are
### not writeable
BASH:~# [ ! -w /d2/foompy ] && echo "Not Writeable"
Not Writeable
BASH:~# [ ! -w /d2 ] && echo "Not Writeable"
Not Writeable
### invoke 'dash' to see the bug
BASH:~# /bin/dash
### use our builtin command 'test' (as [) to confirm
### that files are not writeable as expected
DASH# [ ! -w /d2/foompy ] && echo "Not Writeable"
Not Writeable
### use out builtin command 'test' (as [) to confirm
### that directories are not writeable as expected,
### however, we do NOT get the expected response.
DASH# [ ! -w /d2 ] && echo "Not Writeable"
# [ -w /d2 ] && echo "Writeable"
Writeable
### Not even if the directory is fully declared:
# [ ! -w /d2/. ] && echo "Not Writeable"
#
Unless i'm wrong, the POSIX spec shows nothing for 'test'
that would indicate that behaviour should be different
for file versus directory.
-- System Information:
Debian Release: 6.0.4
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash
Versions of packages dash depends on:
ii debianutils 3.4 Miscellaneous utilities specific t
ii dpkg 1.15.8.12 Debian package management system
ii libc6 2.11.3-3 Embedded GNU C Library: Shared lib
dash recommends no packages.
dash suggests no packages.
-- debconf information:
* dash/sh: true
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]