Why use pwd(1) for getpwd(3C)? (Re: Why use find?)
David Elliott
dce at smsc.sony.com
Fri Oct 12 01:58:03 AEST 1990
In article <1990Oct11.044435.3729 at csusac.csus.edu> jetfuel at csusac.UUCP (Dave Jenks) writes:
>Actually, pwd(1) has no better chance of being able to figure out the
>current directory than getpwd(3) could, since pwd follows the
>directory from "." to "/" using each directory's ".." entry.
This discussion has gotten very off-track.
Dave, you must realize that not all systems are the same. There are
systems on which pwd(1) is setuid root, just as there are systems
without a mkdir(2) system call that have a setuid mkdir(1) command.
These aren't BSD, and they may be considered archaic, but they
do exist.
The fact now is that SVR4, which is supposed to be POSIX-conformant, does
not have a setuid version of pwd, and its version of getcwd(3C) works
just like the BSD getwd(3) routine.
More information about the Comp.unix.programmer
mailing list