Article View: comp.sys.sun
Article #13660Re: Sticky /tmp, bug in getwd(3)?
From: Daniel Ehrlich
Date: Tue, 06 Feb 1990 16:38
Date: Tue, 06 Feb 1990 16:38
34 lines
1960 bytes
1960 bytes
In article <4500@brazos.Rice.edu> moj@mirfak.utu.fi (Matti Jokinen) writes:
> X-Sun-Spots-Digest: Volume 9, Issue 15, message 8 of 20
> In order to increase security I set the sticky bit on the directories
> /tmp, /var/tmp and /var/spool/mail. One consequence was that small files
> started to accumulate in /tmp; the names of the files are of the form
> .getwdaNNNNN, where NNNNN is obviously a process number. It is not
> difficult to guess that the files are created by getwd(3), but I don't
> understand why they are not removed. The result of getwd seems to be
> unaffected.
> My SunOS version is 4.0.3.
The /tmp/.getwdNNNNN files are used as a cache by getwd(3). From the man
page getwd:
FILES
/tmp/.getwd It exists for the sole purpose of the
getwd() library routine; no other
software should depend on its existence
or contents.
If the getwd routine decides that it needs to recreate the .getwd file,
for what ever reason, it will not be able to unlink it if the sticky bit
is set on /tmp and the user running the program is not the owner of the
.getwd file. So, bottom line is, you can not set the sticky bit on /tmp
unless you are willing to periodically clean out the .getwdNNNNN files
that accumulate.
I do not know if we have Sun or AT&T to thank for this one. :-)
Dan Ehrlich <ehrlich@cs.psu.edu>
Voice: +1 814 863 1142 FAX: +1 814 865 3176
Technical Details
Message-ID:
<4805@brazos.Rice.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!iuvax!mailrus!cs.utexas.edu!rice!sun-spots-requestShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!iuvax!mailrus!cs.utexas.edu!rice!sun-spots-request From: ehrlich@cs.psu.edu (Daniel Ehrlich) Newsgroups: comp.sys.sun Subject: Re: Sticky /tmp, bug in getwd(3)? Keywords: Miscellaneous Message-ID: <4805@brazos.Rice.edu> Date: 6 Feb 90 16:38:40 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 34 Approved: Sun-Spots@rice.edu X-Refs: Original: v9n15 X-Sun-Spots-Digest: Volume 9, Issue 38, message 2