bug-bash
[Top][All Lists]
Advanced

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

[ -r file ] falsely reports file to be readable


From: Lasse Collin
Subject: [ -r file ] falsely reports file to be readable
Date: Sun, 10 Oct 2004 14:13:33 +0300
User-agent: KMail/1.6.2

Description:
        Root doesn't always have permissions to read files as someone
        has assumed in function 'test_eaccess' in 'test.c'. This
        assumption breaks some shell scripts if the tested file is not
        actually readable, for example 'upgradepkg' in Slackware.

        This bug exists at least in bash versions 2.05b and 3.00.

Repeat-By:
        As a regular user create a file into NFS exported directory
        that has root_squash turned on in /etc/exports (the default
        setting). The directory should be accessible by all users
        (e.g. drwx-r-xr-x). chmod the created file to 0600 (-rw-------).

        Mount the NFS tree (if not already mounted). Try as root:

                # if [ -r /path/to/file ]; cat /path/to/file ; fi

        Shell says that it is readable but as root cannot read the file
        because of root_squash, cat fails.

Regards,
Lasse Collin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]