Randy's Stupid Question of the day
richj at northcs.com
richj at northcs.com
Fri Sep 8 16:26:31 CDT 2000
Your reply:
>>From owner-kclug at illiana.net Fri Sep 8 10:15:27 2000
>>From: "Duston, Hal" <hdusto01 at sprintspectrum.com>
>>To: "'kclug at kclug.org'" <kclug at kclug.org>
>>Subject: RE: kclug - Randy's Stupid Question of the day
>>Date: Fri, 8 Sep 2000 10:12:13 -0500
>>
>>Randy,
>>
>>The bits that are ON in the umask are turned OFF when a file
>>is created. So if you want to create rwxr-xr-x, you need a
>>umask of 022, and then manually set the file to +x.
>>
>>>From the HP/UX manpage:
>>When a new file is created (see creat(2)), each bit that is set
>>in the file mode creation mask causes the corresponding
>>permission bit in the the file mode to be cleared (disabled).
>>Conversely, bits that are clear in the mask allow the
>>corresponding file mode bits to be enabled in newly created
>>files.
>>
>>For example, the mask u=rwx,g=rx,o=rx (022) disables group and
>>other write permissions. As a result, files normally created
>>with a file mode shown by the ls -l command as -rwxrwxrwx (777)
>>become mode -rwxr-xr-x (755); while files created with file mode
>>-rw-rw-rw- (666) become mode -rw-r--r-- (644).
>>
>>Note that the file creation mode mask does not affect the
>>set-user-id, set-group-id, or "sticky" bits.
>>
>>I am not sure how to get the execute bits to be on by default...
>>
-------------------------------------------------------------
Good answer, assuming he knows how to talk octal and doesn't
think 022 is a decimal number.
For a normal file, there would be no need to have the
execute(x) bit turned on. Has a diffent meaning altogether
when dealing with directories, but believe his original
question related to files.
Richard Johnson
-------------------------------------------------------------
>>Hal Duston
>>hald at sound.net
>>
>>Randy Rathbun [randy at rrr.2y.net] wrote:
>>> Okay, I give.
>>>
>>> How in the world does umask work? I am trying to change it to
>>> rwxr-xr-x. If it is 022, it is rw-r--r--. Okay, *that* makes total
>>> sense... ahem.
>>>
>>> And then setting it to 220 results in r--r--rw. And even
>>> stranger stuff
>>> starts if I go to other numbers.
>>>
>>> Anyone care to explain this?
>>>
>>>
>>> Randy Rathbun
>>> randy at rrr.2y.net
>>> http://rrr.2y.net
>>
>>
>>
>>
>>
More information about the Kclug
mailing list