10-22-04 10:53 PM
Kenny McCormack wrote:
> According to "man chmod" on Solaris, "g+s" (aka, the 2000 bit) must be
> specified symbolically (that is as "g+s", not as 2000). And, indeed, my
> testing shows this to be the case. "chmod 2755 /some/dir" sets it to 755.
>
> Questions
> 1) Why is this?
> 2) Is it true on any other Unixes?
>
Hi Kenny,
the first octal digit specifies, whether the set user id (4), the set
group id (2) or the sticky bit (1) shall be set. Testing on SunOS 5.6
gives the following:
% touch test
% ls -l test
-rw-r--r-- 1 steve staff 0 Oct 22 23:35 test
% chmod 1644 test
-rw-r--r-T 1 steve staff 0 Oct 22 23:35 test
% chmod 2644 test
-rw-r-Sr-- 1 steve staff 0 Oct 22 23:35 test
% chmod 4644 test
-rwSr--r-- 1 steve staff 0 Oct 22 23:35 test
% chmod g+s test
-rwSr-Sr-- 1 steve staff 0 Oct 22 23:35 test
% chmod 2000 test
------S--- 1 steve staff 0 Oct 22 23:35 test
Can't see anything unusal here. Specifying the suid/sgid/sticky bit can
be done either using numerical notation or the symbolic constant s. This
is also true with Tru64 Unix 5.1b. If you have other experiences, just
let me know.
\Steve.
[ Post a follow-up to this message ]
|