ls permission "l"?

stone at sheba.UUCP stone at sheba.UUCP
Tue Sep 23 03:29:07 AEST 1986


In article <197 at osi3b2.UUCP> james at osi3b2.UUCP (James R. Van Artsdalen) writes:
>I have access to a 3b2-310 running System V 2.1 (virtual memory version).  When
>I did an "ls -l /usr/spool/cron/atjobs" I got this:
>
>total 2
>-r-Sr-lr--   1 james    osi          740 Sep 18 06:14 527490000.a
>
>Anybody know what the "l" means (or >would mean on a more appropriate file)?

This is an artifact of the new file/record locking scheme provided
via fcntl(2) and lockf(3).  The "l" means that locking done on the
file or portions of it will be mandatory locking.  There are two
types of locking provided, mandatory and advisory.  Mandatory locks
are obeyed by all processes, while advisory locks are only visible to
other processes also using advisory locks.  By default all locks are advisory.
To make mandatory locks the "Set Group ID" bit needs to be set first on the
file.  So now the SGID bit has two meanings.  Chmod(1) has been changed to
disallow chmod s+g on files that are not executable, and to disallow chmod +l
(set mandatory locking) on files that are executable.  But chmod(2) has not
been changed to prevent this.

So what you are seeing is ls(1) being confused by seeing the SGID bit set on a
file that is not executable.

David Stone
Arete Systems		!sun!arete!stone or 
			{grape,dlb,cdp,hplabs!hpspdla}!sheba!stone



More information about the Comp.unix mailing list