Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ki4pv.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!ki4pv!tanner From: tanner@ki4pv.UUCP (Tanner Andrews) Newsgroups: net.bugs.4bsd Subject: Re: EXCL without CREAT Message-ID: <7022@ki4pv.UUCP> Date: Wed, 18-Dec-85 10:09:11 EST Article-I.D.: ki4pv.7022 Posted: Wed Dec 18 10:09:11 1985 Date-Received: Sat, 21-Dec-85 01:26:46 EST References: <5507@allegra.UUCP>, <6220@utzoo.UUCP> Organization: CompuData South, DeLand Lines: 12 ] utzoo!henry points out problem of fool opening/locking /etc/passwd ] and claims that adding open("arg", O_READ|EXCL) re-invents flock() Doesn't re-invent flock() -- open()/flock() is not an atomic action. Security is easily solved by refusing to allow locking a file unless the file has been successfully opened for WRITE -- there's no real excuse for a read-only prog to need to lock a file if the write-file prog successfully locks the damned thing anyway. -- Tanner Andrews, KI4PV uucp: ...!decvax!ucf-cs!ki4pv!tanner