0

On a Solaris 11 machine, when I execute chmod 2000 myfile, I get l instead of S or s:

touch myfile && chmod 2000 myfile && ls -l myfile
------l---. 1 pydoge pydoge 0 Oct 16 12:35 myfile

But when I execute chmod 2010, I get what I was expecting:

touch myfile && chmod 2010 myfile && ls -l myfile
------s---. 1 pydoge pydoge 0 Oct 16 12:35 myfile

Why is that? On my Linux machine:

[pydoge@leninovo tmp] $ touch myfile && chmod 2000 myfile && ll myfile
------S---. 1 pydoge pydoge 0 Oct 16 12:35 myfile
1
  • This has to do with mandatory locking. See the Solaris manual for chmod.
    – Kusalananda
    Oct 16, 2018 at 10:41

1 Answer 1

0

You may like to check the Solaris man page for chmod:

http://schillix.sourceforge.net/man/man1/chmod.1.html

and for ls:

http://schillix.sourceforge.net/man/man1/ls.1.html

Mandatory locking l is in effect on a regular file when the x bit is not set while the set group-ID bit is set.

If the x bit is set at the same time as the set group-ID bit, this really means set group id.

7
  • What is strange, though, is that this is a part of a test that I'm maintaining... We chmod something to 2000 on Linux, Solaris, and HPUX, and check for s or S being the only perm set. This started failing on Oct. 8th, so 8 days ago... How was it ever passing if this is a regular feature..? :/
    – pydoge
    Oct 16, 2018 at 11:00
  • Solaris behaves this way since more than 25 years.
    – schily
    Oct 16, 2018 at 11:03
  • 2
    IMHO, it would be more authoritative to link to the Oracle Solaris pages instead of to a sourceforge page, particularly if you're claiming that they are "the Solaris man page"...
    – Jeff Schaller
    Oct 16, 2018 at 11:15
  • man ls and man chmod
    – Jeff Schaller
    Oct 16, 2018 at 11:16
  • 2
    Because it’s a sourceforge site not the Oracle Solaris site.
    – Jeff Schaller
    Oct 16, 2018 at 11:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .