vipw - the program

Rob McMahon cudcv at warwick.ac.uk
Sat Oct 22 20:55:18 AEST 1988


In article <14043 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>In article <218 at fantasci.UUCP> jep at fantasci.UUCP (Joseph E Poplawski) writes:
>>if [ -f "/etc/ptmp" ]; then exit 1; else cat /dev/null >/etc/ptmp ...
>
>This has a window during which it will not notice the lock file.
>You are much better off using links, viz.:
>...
>	if ln $tf $lock 2>/dev/null; then exit 1; else ...

Except that this seems to be silently broken under (at least some versions of)
System V, in which ln(1) deletes the file first, and the command succeeds.
See:

Newsgroups: news.software.b,comp.sources.bugs
Subject: C News Bulletin #8 - fixes for illegal message-IDs, System V ln(1)
Message-ID: <1988Oct18.064611.25833 at utstat.uucp>

`mkdir $lock' should still work though ...

Rob
-- 
UUCP:   ...!mcvax!ukc!warwick!cudcv	PHONE:  +44 203 523037
JANET:  cudcv at uk.ac.warwick             ARPA:   cudcv at warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England



More information about the Comp.unix.questions mailing list