Re: permissions not honoured by /bin/pwd aka getcwd

From: Jesse Pollard (pollard@tomcat.admin.navo.hpc.mil)
Date: Thu Feb 24 2000 - 12:42:40 EST


Anton Ivanov <aivanov@eu.level3.net>:
>strace on linux shows a call to getcwd (3). Return is correct path and no
>errors.

At least under 2.0 I get the proper response:

bash$ mkdir -p test/test1
bash$ ls -Rl test
total 1
drwxr-xr-x 2 pollard users 1024 Feb 24 11:33 test1

test/test1:
total 0
bash$ cd test/test1
bash$ pwd
/tmp/test/test1
bash$ /bin/pwd
/tmp/test/test1
bash$ chmod 000 ..
bash$ pwd
/tmp/test/test1
bash$ /bin/pwd
/bin/pwd: cannot get current directory: Permission denied

I thought getcwd was doing the I/O to determine the working directory.
To get a _final_ word we'd have to "use the Source". Does strace work
through shared libraries? I don't know that answer either; it seems like
it would.
-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:10 EST