getcwd() and friends.

Ed Gould ed at mtxinu.COM
Wed Apr 5 09:59:10 AEST 1989


 >>One thing that really would make things a lot easier would be a fchdir()
 >>call, that took a file descriptor and tried to chdir to it.

 >However ... all of the information needed for a chdir() is not present
 >in the file descriptor.  It is possible to be handed a file descriptor
 >which you would not be able to have opened because some component of
 >the search path denies access now, but at some point in the past did
 >allow access.

Worse than that, the permission required to open a directory is "r"
(since one may not open a directory for writing), whereas the
permission required to change to one is "x".  Hence, Unix protection
would be completely violated by the existance of fchdir().

-- 
Ed Gould                    mt Xinu, 2560 Ninth St., Berkeley, CA  94710  USA
ed at mtxinu.COM		    +1 415 644 0146

"I'll fight them as a woman, not a lady.  I'll fight them as an engineer."



More information about the Comp.unix.wizards mailing list