Răspuns: Răspuns: chmod behaviour
Yes, this is it.
Does this apply to the older versions ? I'd have to check it out. Thank you for all of your replies. ________________________________ De la: Jonathan S Billings <jsbillin@umich.edu> Către: redhat-list@redhat.com Trimis: Vineri, 4 Noiembrie 2011 13:29:56 Subiect: Re: Răspuns: chmod behaviour On 11/04/2011 03:27 AM, RuceLee wrote: > [root@core2duo ~]# chmod 0755 my_directory/ #set perm in octal mode > [root@core2duo ~]# ll -d my_directory/ #no effect on SGIT bit > drwxr-sr-x 2 root root 4096 NovÂ* 4 08:16 my_directory/ > > [root@core2duo ~]# chmod g-s my_directory/ #set perm in symbolic mode > [root@core2duo ~]# ll -d my_directory/ #get back to the execution bit > drwxr-xr-x 2 root root 4096 NovÂ* 4 08:16 my_directory/ > > I'm confused cuz up until now I assumed the octal and symbolic mode > are interchangeable and here is an example where I rather have to use a > single mode to get to expected result. The documentation from coreutils: https://www.gnu.org/s/coreutils/manual/html_node/Directory-Setuid-and-Setgid.html#Directory-Setuid-and-Setgid Basically, you can't use the numeric modes to clear a directory's set-user-id and set-group-id bits.Â* You have to use the symbolic mode to clear them. The RHEL6 man page for 'chmod' actually mentions this in the "SETUID AND SETGID BITS" section: Â* Â* Â* chmod preservesÂ* aÂ* directory’sÂ* set-user-IDÂ* and Â* Â* Â* set-group-IDÂ* bitsÂ* unless you explicitly specify Â* Â* Â* otherwise.Â* You can set or clearÂ* theÂ* bitsÂ* with Â* Â* Â* symbolicÂ* modes like u+s and g-s, and you can set Â* Â* Â* (but not clear) the bits with a numeric mode. -- Jonathan Billings <jsbillin@umich.edu> College of Engineering - CAEN - Unix and Linux Support -- redhat-list mailing list unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list -- redhat-list mailing list unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list |
| All times are GMT. The time now is 06:38 AM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.