Re: chmod: Why must "g+s" be specified symbolically (at least in
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Re: chmod: Why must "g+s" be specified symbolically (at least in




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: chmod: Why must "g+s" be specified symbolically (at least in  
Steve Graegert


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:54 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register