Xref: utzoo comp.unix.questions:9440 comp.bugs.sys5:584 Path: utzoo!attcan!uunet!mcvax!inria!gouldfr!cetia!chris From: chris@cetia.UUCP (Chris Bertin) Newsgroups: comp.unix.questions,comp.bugs.sys5 Subject: Re: SVR3 passwd changes mode of passwd file Summary: there is MUCH worse in SYSV meddling with files!!! Message-ID: <131@cetia.UUCP> Date: 26 Sep 88 12:14:03 GMT References: <3394@dunkshot.mips.COM> <7@marvin.UUCP> <3699@dunkshot.mips.COM> Organization: Cetia, Toulon, France Lines: 21 To change the mode of a file without being requested to is one thing, but SYSV does much better when it comes to the 'utmp' handling. For fun, do $ cp /etc/passwd /tmp $ ls -l /tmp/passwd $ who /tmp/passwd $ ls -l /tmp/passwd If the utmp code finds that the file you are doing 'who' on is not in 'utmp' format, it ZEROES the file!!! Thank you AT&T. The code is in libc/gen/getut.c. The wonderful comment says: /* Make sure file is a multiple of 'utmp' entries long */ and if the file is not a multiple, it does an 'unlink' and a 'creat'... Chris -- Chris Bertin | CETIA | 150, Av Marcelin Berthelot, Z.I. Toulon-Est +33(94)212005 | 83088 Toulon Cedex, France Ext: 239 | inria!cetia