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: 1070f0,d4c1f7c0fe672a4 X-Google-Attributes: gid1070f0,public X-Google-Thread: 1164f8,d4c1f7c0fe672a4 X-Google-Attributes: gid1164f8,public From: peter@baileynm.com (Peter da Silva) Subject: Re: Yet Another Ultimate TMP-cleaner algorithm! Date: 1998/09/22 Message-ID: <6u8n1s$667@web.nmti.com>#1/1 X-Deja-AN: 393712117 References: <35F71814.1E0B911C@iakom.com> <36079B1B.2781@s054.aone.net.au> <6u88qm$t5u@web.nmti.com> <3607C878.85DA16C1@fpk.hp.com> 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 <3607C878.85DA16C1@fpk.hp.com>, Chris Calabrese wrote: >This is pretty good but has two problems: > o It's slow for deep directory trees > o It's not guaranteed to work for pwd returning > very long paths (like longer than PATH_MAX). >However, we don't actually have to check the whole path, just >the last component if we check device/inode of .. vs . instead of >names That won't help if the file they're trying to trick you into unlinking is also in /tmp. And yes, there can be security issues in removing temp files and replacing them with whatever you want. /tmp/.X11-unix/X0 for example. Makes for a great password stealer. >Now, if there were an funlink system call, you could even get >rid of the race condition of a regular file changing after >that stat and before the unlink. Since there can be multiple links to a file, how do you know which one to unlink? -- In hoc signo hack, Peter da Silva `-_-' "Milloin halasit viimeksi suttasi?" 'U` "Tell init(8) to lock-n-load, we're goin' zombie slaying!"