PWD Help Request

Spencer W. Thomas thomas at utah-gr.UUCP
Mon Oct 24 07:12:15 AEST 1983


Another reason for using the popen("pwd"...) hack is that you can make
pwd to be setuid (root), so when you are trying to find out the current
directory from within a setuid program which does not have access to the
path leading to the cwd, you can still do it.  (That's pretty
convoluted, let me make an example.)

Suppose that ~ is rwx------, but ~/foo is rwxr-xr-x.  You are connected
to ~/foo and you say
	uucp -c bar.c baz!~uucp/bar.x
Uucp forks pwd to find out your cwd, and if pwd is vanilla, uucp gives
up because it can't figure out the name of the working directory, even
though it has access to the file, and can copy it to ~uucp.  If the
getcwd routine were built into uucp, there would be no hope in this case.

=Spencer



More information about the Comp.unix mailing list