Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!vaxine!wjh12!genrad!decvax!harpo!utah-cs!utah-gr!thomas From: thomas@utah-gr.UUCP (Spencer W. Thomas) Newsgroups: net.unix Subject: Re: PWD Help Request Message-ID: <950@utah-gr.UUCP> Date: Sun, 23-Oct-83 17:12:15 EDT Article-I.D.: utah-gr.950 Posted: Sun Oct 23 17:12:15 1983 Date-Received: Tue, 25-Oct-83 00:06:38 EDT References: sri-arpa.12548 Lines: 15 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