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: 10872d,d4c1f7c0fe672a4 X-Google-Attributes: gid10872d,public X-Google-Thread: 1164f8,d4c1f7c0fe672a4 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1070f0,d4c1f7c0fe672a4 X-Google-Attributes: gid1070f0,public X-Google-Thread: 1020c6,d4c1f7c0fe672a4 X-Google-Attributes: gid1020c6,public X-Google-Thread: fcda7,d4c1f7c0fe672a4 X-Google-Attributes: gidfcda7,public From: "schwartz+!usenet%"@((Scott Schwartz))bio.cse.psu.edu (Scott Schwartz) Subject: Re: Secure cleaning of /tmp was Different Unixes pros & cons Date: 1998/10/24 Message-ID: <8gbtn2y16k.fsf@galapagos.cse.psu.edu>#1/1 X-Deja-AN: 404524097 References: <35F71814.1E0B911C@iakom.com> <36069B1E.14553C26@llnl.gov> <6u67of$cae@web.nmti.com> <51zN1.54$LN.897820@burlma1-snr1.gtei.net> <6u6gie$fgk@web.nmti.com> Organization: Deparment of Computer Science and Engineering, The Pennsylvania State University Newsgroups: comp.unix.admin,comp.sys.hp.hpux,comp.sys.sgi.admin,comp.sys.sun.admin,comp.sys.dec,comp.security.unix peter@baileynm.com (Peter da Silva) writes: > 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. Plan 9: term% mkdir A B C D term% bind -b B A term% touch A/1 term% bind -b C A term% touch A/2 term% bind -b D A term% touch A/3 term% ls A B C D A/1 A/2 A/3 B/1 C/2 D/3 However, union mounts apply to directories, not trees, so you can still alter the contents of old subdirectories of B or C from A, which isn't what you want. BSD union mounts might work differently, more like Sun's old translucent file system? > 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. Plan 9 again; this is the actual convention: term% grep tmp $home/lib/profile bind -c $home/tmp /tmp > Best would be a special tmpfs with file aging. Plan 9 lets users mount anything they want on /tmp. An instance of a ramdisk, for example. This and the previous example rely on a nice property that Unix doesn't have: per-process namespaces.