bug-bash
[Top][All Lists]
Advanced

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

Re: bug in [ -f file ] test


From: Chet Ramey
Subject: Re: bug in [ -f file ] test
Date: Wed, 27 Jul 2016 18:33:34 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 7/27/16 3:34 PM, László Házy wrote:
> You have probably not done the first command: "[user1]$ chmod g+rx
> /home/user1". In my case, there is no access problem. I can ls and cd.
> Thing is, even root gets the wrong answer if it does the "is file?" query.

I performed that command, but I tore it all down and rebuilt it anyway.
Running a system call tracer (strace) shows that stat ("/var/tmp/link", )
returns -1 with errno == EACCES.  `cat' displays "Permission Denied", and
`cp' says "cannot stat".

What does strace show when you run it as user1 with a script that contains

[[ -f /var/tmp/link ]]
echo $?

?

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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