Isn't it amazing what you find in the manuals?

Richard Stevens stevens at hsi.UUCP
Wed Feb 22 21:16:29 AEST 1989


In article <6034 at cbmvax.UUCP>, ditto at cbmvax.UUCP (Michael "Ford" Ditto) writes:
> I thought locking() only provided advisory locks.  Have you actually
> tried those examples?  I'm not near a Unix PC at the moment so I can't
> try it or look at the manual.  If it really does provide enforcement
> locking, then yes, it is a serious problem.

Unknown to most, and, of course, undocumented, is the fact that the
3b1 (3.5.1 software) supports both advisory and mandatory locking.
Read the first sentence of the lockf(3C) man page - see the reference
to chmod(2).  Well, they updated the lockf man page, but not the
chmod page.  You have to go to a real System VR3 manual to see
just what to do to get mandatory locking.  You enable mandatory
locking for a given file by setting its set-group-ID bit on and
its group-execute bit off.  Then any locks applied to that file
are mandatory, not advisory.  Otherwise, by default, all locks
are advisory only.  The real SVR3 ls(1) command was enhanced to
look for this, and it notes it (I can't remember just how as my
SVR3 manuals aren't handy).  Unfortunately, the 3b1's ls never got
updated.

I've tested the mandatory locking on the 3b1 and it does work.
There is definetely a strange combination of Unix versions in
the 3b1's Unix system.

	Richard Stevens
	Health Systems International, New Haven, CT
	   stevens at hsi.com
           ... { uunet | yale } ! hsi ! stevens



More information about the Unix-pc.general mailing list