Why use pwd(1) for getpwd(3C)? (Re: Why use find?)

Conor P. Cahill cpcahil at virtech.uucp
Thu Oct 11 23:09:39 AEST 1990


In article <23012:Oct1019:12:2790 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
>In article <1990Oct9.122813.1329 at cbnews.att.com> jbr0 at cbnews.att.com (joseph.a.brownlee) writes:
>  [ why is getpwd() implemented as `pwd` in System V? ]
>
>Because there's no getwd() system call to have the kernel do the job.
>Unless you have some sort of privileges, you won't be able to figure
>out the current directory when any higher directory is unreadable.

However, on most, if not all, current system V implementatins pwd is not
setuid and only has the privileges of the user who invoked it, so it
won't make a difference as to whether it is a function or a pipe.

-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 



More information about the Comp.unix.programmer mailing list