🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #1012

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

#1012
From: John Cowan
Date: Thu, 11 Oct 1990 17:01
23 lines
1504 bytes
In article <14976@hydra.gatech.EDU> gt0178a@prism.gatech.EDU (Jim Burns) writes:
>in article <1990Oct10.231857.11668@virtech.uucp>, cpcahil@virtech.uucp (Conor P. Cahill) says:
>> I don't know the reason for making it a call to popen(),  one reason may
>> have been security (pwd could be a setuid pgm and do things that a 
>> function call couldn't).
>
>Not on my system (see below). And what about those shells that have pwd
>builtin? My shell's pwd seems to work fine, and the shell isn't setuid
>either.
>
>-rwxr-xr-x  1 root        16384 Nov 17  1989 /bin/pwd*
>-rwxrwxr-x  2 root       152692 Sep 18 11:51 /usr/local/bin/ksh*

Try saying 'chmod u-rwx .' and then '/bin/pwd'.  You'll probably get
something like "pwd: can't stat .", at least that's what I get.
(This assumes your system doesn't have a built-in get[p]wd() call.
If it does, all bets are off.)

/bin/pwd should be setuid root so that it doesn't get this error.

-- 
cowan@marob.masa.com			(aka ...!hombre!marob!cowan)
			e'osai ko sarji la lojban
Technical Details
Message-ID: <2714A558.14A8@marob.masa.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!crdgw1!rpi!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!yale!cmcl2!phri!marob!cowan
References: <1990Oct10.231857.11668@virtech.uucp> <14976@hydra.gatech.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!crdgw1!rpi!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!yale!cmcl2!phri!marob!cowan
From: cowan@marob.masa.com (John Cowan)
Newsgroups: comp.unix.programmer
Subject: Re: Why use pwd(1) for getpwd(3C)? (Re: Why use find?)
Message-ID: <2714A558.14A8@marob.masa.com>
Date: 11 Oct 90 17:01:11 GMT
References: <1990Oct10.231857.11668@virtech.uucp> <14976@hydra.gatech.EDU>
Organization: The Logical Language Group, Inc.
Lines: 23