what is the 'l' permission?

Guy Harris guy at auspex.UUCP
Sat Nov 26 16:27:30 AEST 1988


>Consider a program that mandatory-locks /etc/passwd and then sleeps forever.
>Antisocial, no?  So mandatory locking is available only on files that are
>explicitly marked as "okay to lock".

Well, actually, in order to lock out reads, you have to establish a
write lock on the region in question, and to establish a write lock you
need to have a file descriptor open for writing; if you have a file
descriptor for "/etc/passwd" that's open for writing, you can do much
more antisocial things than just locking it forever.... 

In AT&T's documentation, they appear to recommend that you not use
mandatory locking because there's extra overhead on every read or write
performed, since before every read or write the system has to check for
locks.  They also note that mandatory locking is not always necessary
nor sufficient.



More information about the Comp.unix.wizards mailing list