EXCL without CREAT

Tanner Andrews tanner at ki4pv.UUCP
Thu Dec 19 01:09:11 AEST 1985


] 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.
-- 
<std dsclm, copies upon request>	   Tanner Andrews, KI4PV
uucp:					...!decvax!ucf-cs!ki4pv!tanner



More information about the Comp.bugs.4bsd.ucb-fixes mailing list