getcwd() and friends.

Peter da Silva peter at ficc.uu.net
Wed Apr 5 14:53:34 AEST 1989


In article <3675 at ficc.uu.net> peter at ficc.uu.net (Peter da Silva) writes:
>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. All the info
>that UNIX needs for the chdir is available via the fd.

In article <14689 at rpp386.Dallas.TX.US>, jfh at rpp386.Dallas.TX.US (John F. Haugh II) writes:
> 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.

That's an issue worth considering, but I'm not sure that it's really
a security problem. After all, you could always spawn a child in a
directory and send it messages over a pipe. Same thing, just a little more
complex.

It would be really nice to be able to pass an fd to another program, too.
-- 
Peter da Silva, Xenix Support, Ferranti International Controls Corporation.

Business: uunet.uu.net!ficc!peter, peter at ficc.uu.net, +1 713 274 5180.
Personal: ...!texbell!sugar!peter, peter at sugar.hackercorp.com.



More information about the Comp.unix.wizards mailing list