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: 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 X-Google-Thread: 1164f8,d4c1f7c0fe672a4 X-Google-Attributes: gid1164f8,public From: Jim Mellander Subject: Re: Different UNIX pro's and con's. Date: 1998/09/21 Message-ID: <36069D3E.10DF1CFA@llnl.gov>#1/1 X-Deja-AN: 393371197 Content-Transfer-Encoding: 7bit References: <35F71814.1E0B911C@iakom.com> <3602C849.C70612C6@llnl.gov> <360688CC.45AA59CA@llnl.gov> <6u5v9e$f0i$1@pravda.ucr.edu> Content-Type: text/plain; charset=us-ascii Organization: Lawrence Livermore National Laboratory Mime-Version: 1.0 Newsgroups: comp.unix.admin,comp.sys.hp.hpux,comp.sys.sgi.admin,comp.sys.sun.admin,comp.sys.dec,comp.security.unix Chris Ulrich wrote: > > Why not just turn the sticky bit off, run the /tmp sweeper as a > normal UID, and then set the sticky bit after the sweeper runs? > Then the badguy can delete anything in /tmp, but they can't make > root delete random files anywhere on the filesystem. > The problem here is that /tmp is set for a perm of 1777, which means that only root & the owner of the file can delete it. But this discussion gave me an idea: Why not fork off a child, change the EUID to the owner of the file, and delete the file as the owner. If the perms on system directories are set correctly, even a symlink atack would fail. This is massively wasteful of system resources (1 fork/file), but since the /tmp sweep is usually run in the wee hours of the morning, that wouldn't be so bad. Some Unices let you switch back & forth between EUID & Real UID, so this may not apply. This may actually be secure, if the sweeper skips files owned by root.