From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10952f,b69d377feb5a8a2 X-Google-Attributes: gid10952f,public X-Google-Thread: fcda7,d4c1f7c0fe672a4 X-Google-Attributes: gidfcda7,public X-Google-Thread: 10872d,d4c1f7c0fe672a4 X-Google-Attributes: gid10872d,public X-Google-Thread: 1020c6,d4c1f7c0fe672a4 X-Google-Attributes: gid1020c6,public X-Google-Thread: 1164f8,d4c1f7c0fe672a4 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1070f0,d4c1f7c0fe672a4 X-Google-Attributes: gid1070f0,public From: peter@baileynm.com (Peter da Silva) Subject: Re: Secure cleaning of /tmp was Different Unixes pros & cons Date: 1998/09/21 Message-ID: <6u6gie$fgk@web.nmti.com>#1/1 X-Deja-AN: 393434447 References: <35F71814.1E0B911C@iakom.com> <36069B1E.14553C26@llnl.gov> <6u67of$cae@web.nmti.com> <51zN1.54$LN.897820@burlma1-snr1.gtei.net> Organization: Bailey Network Management Newsgroups: comp.unix.admin,comp.sys.hp.hpux,comp.sys.sgi.admin,comp.sys.sun.admin,comp.sys.dec,comp.security.unix In article <51zN1.54$LN.897820@burlma1-snr1.gtei.net>, Barry Margolin wrote: >If your goal is to avoid race conditions that can be used as security >holes, you're probably right. But if your goal is a fully correct /tmp >cleaner, possibilities like this will always exist unless special kernel >support is provided. There's a number of hacks you can use to get the same result, though they do require moderate exotica... they're not specifically kernel support for temp cleaning. You could use union mounts. Union mount a new temp over the old one before you run the cleaner on the old one. Now the problem reduces to what happens when you run out of resources for the nth union mount. You'd need to be able to unmount stuff from the bottom of the mount stack. If you have variable symlinks you can pull a nasty trick: mkdir /usrtmp for user in ($USERS) do mkdir /usrtmp/$i; chown $i /usrtmp/$i done ln -s '/usrtmp/$(LOGNAME)/tmp' /tmp # modulo variable symlink syntax Now anyone accessing /tmp will find themselves in a private temp dir they own. Best would be a special tmpfs with file aging. -- In hoc signo hack, Peter da Silva `-_-' "Milloin halasit viimeksi suttasi?" 'U` "Tell init(8) to lock-n-load, we're goin' zombie slaying!"