- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Confused about umask
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2002 08:52 AM
01-24-2002 08:52 AM
# umask
00
# umask -S
u=rwx,g=rwx,o=rwx
# cd /tmp
# touch junk
# ll junk
-rw-rw-rw- 1 root sys 0 Jan 24 11:49 junk
Why aren't the permissions on junk
-rwxrwxrwx?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2002 08:57 AM
01-24-2002 08:57 AM
SolutionDirectories on the other hand (try doing a mkdir junk) will be created with -rwxrwxrwx if your umask is 0. That is becuase execute has to be set on a directory to cd into it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2002 09:00 AM
01-24-2002 09:00 AM
Re: Confused about umask
The files will be created with -rw-rw-rw permission only. But the directories will be created with rwxrwxrwx.
Check the man pages of umask, it will explian you in detail.
HTH,
Shiju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2002 09:04 AM
01-24-2002 09:04 AM
Re: Confused about umask
110 110 110 => default settings
000 000 000 => umask
--- --- --- => logical AND operation
110 110 110 => 666
a umask of 132 will yield the final permissions you say you want
110 110 110
001 011 010
--- --- ---
111 101 100 => 754 or -rwxr-xr--
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2002 09:09 AM
01-24-2002 09:09 AM
Re: Confused about umask
...just proves the point, never answer a question before your first cup of coffee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2002 09:17 AM
01-24-2002 09:17 AM
Re: Confused about umask
umask doesn??t set the default permission of a new file. The application is which should decide with which permissions should the file be created and the umask is used for making a logical AND operation between the permissions desired by the application and itself(man umask). For example if you make a tusc of the touch process you can see that this program use this system call
open("prueba_2", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) =
If you make man 2 open you can see the next information:
O_CREAT If the file exists, this flag has no effect,
except as noted under O_EXCL below. Otherwise,
the owner ID of the file is set to the effective
user ID of the process, the group ID of the file
is set to the effective group ID of the process i
the set-group-ID bit of the parent directory is
not set, or to the group ID of the parent
directory if the set-group-ID bit of the parent
directory is set.
The file access permission bits of the new file
mode are set to the value of mode, modified as
follows (see creat(2)):
+ For each bit set in the file mode creation mask
of the process, the corresponding bit in the
new file mode is cleared (see umask(2)).
+ The "save text image after execution" bit of
the new file mode is cleared. See chmod(2).
+ On systems with access control lists, three
base ACL entries are created corresponding to
the file access permissions (see acl(5)).
So the final permissions of a file are not only set by the umask value. The application should decide which permission need the file and the system should decide if that permissions are right or not.
Best regards.