- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Trouble understanding umask and permissions on new...
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
05-18-2004 09:11 AM
05-18-2004 09:11 AM
However, when I create a file with vi it has the permission -rw-r--r--
I thought I understood permissions and umask but obviously there is something I'm missing.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2004 09:18 AM
05-18-2004 09:18 AM
Re: Trouble understanding umask and permissions on new files
It is for the creation of the files and the setting of execution bit is to be done seperately using "chmod" command. With the umask 022, the files get 'created' with the permissions -rw-r--r--.
You don't have much choice there.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2004 09:19 AM
05-18-2004 09:19 AM
Re: Trouble understanding umask and permissions on new files
default file permission: -rw-rw-rw
default dir permission: -rwxrwxrwx
if you apply umkas of 022
access permissions of the new file created would ne = 666 - 022 = 644 (rw-r--r--)
for dirs = 777 - 022 = 755 (rwxr-xr-x)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2004 09:20 AM
05-18-2004 09:20 AM
SolutionIf you are developing in C, for example, both the open() and creat() system calls allow you to creat a file with whatever mode you wish in one step.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2004 09:28 AM
05-18-2004 09:28 AM
Re: Trouble understanding umask and permissions on new files
by default when creating a file you have to do a chmod to make the file executable. just safer to do things that way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2004 09:53 AM
05-18-2004 09:53 AM
Re: Trouble understanding umask and permissions on new files
- Paul N.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2004 11:35 AM
05-18-2004 11:35 AM
Re: Trouble understanding umask and permissions on new files
When you have "umask 022" in your startup file (.cshrc or .profile) you will get file permissions of 644 instead of 755. This is a security "feature". Under modern UNIX versions, umask cannot be used to set execute permissions on files, only directories, where execute is
synonymous with "searchable".
With "umask 022" I see people believing that the "default permission" is 777. They are wrong. 777 is "global" read, write, and execute permissions, something you do not generally want to happen. Thus the need to chmod the file to make it executable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2004 11:45 AM
05-18-2004 11:45 AM
Re: Trouble understanding umask and permissions on new files
Thought I'd try to do a little explanation of file permissions. Each digit corresponds
to the permissions for user, group, and other ... respectively.
The umask is subtracted from 777 / 666 to give the permission set.
So, since you have a umask 022, 666-022 leaves 644 (rw-r--r--). As r=4, w=2, x=1,
644 is user rw- (4+2) group r-- (4) others r-- (4).
Hope this adds some clarity.