Re: Umask question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/17/07, Sjoerd Mullender <sjoerd@xxxxxxx> wrote:
On 2007-01-17 17:06, Aaron Konstam wrote:
> On Wed, 2007-01-17 at 10:04 -0600, Aaron Konstam wrote:
>> On Wed, 2007-01-17 at 08:10 -0600, Styma, Robert E (Robert) wrote:
>>>  > Hi
>>>> if I issue the ommand umask I get a value of 0022. I thought umask
>>>> values were 022, what's the extra digit for?
>>>>
>>>> Thanks
>>>> Dan
>>> By convention, octal numbers have a leading zero.  This is a
>>> carry over from the C programming language.
>>>
>>> Bob
>>>
>> I am not sure that is true. There is a forth (the first on in the
>> output) that refers to SUID, GUID and stcky bit,
> I should try my answer before I shoot off my mouth. It looks like umask
> cannor set that fourth digit, so I guess I am wrong.

There are 9 permission bits that are relevant to umask in 3 groups of 3:
user, group, other, and for each of those, read, write, execute.  By
displaying the permissions in octal, you get one digit for each of those
groups.  Hence it is useful for umask to display three octal digits to
display the complete mask.  Note that ordinarily the first of those
three digits is 0, since you typically don't want the user (owner of the
file)'s permissions to be curtailed by the umask.

The fourth (or rather, first) digit is always 0 since in C a leading 0
in a number indicates that the number is given in octal (just like a
leading 0x indicates that the number is in hexadecimal).

So we arrive at four digits, the first two of which are 0: leading zero
to indicate octal number, zero to indicate no permissions removed for
user, and then the two 2s to indicate that write permission is to be
removed for other members of the group and everyone else in the world.

I hope this makes things clear.


--
Sjoerd Mullender

Hi All

Many thanks for your replies. Its a lot clearer now.

Regards
Dan

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux