- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- setting umask value
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
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
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
тАО06-26-2006 07:24 AM
тАО06-26-2006 07:24 AM
One of the app developer is trying to aet umask value in his script to uamsk 077. But after running his profile, umask is still showing 022 default value.
The purpose is, the files created by this user must have umask of 077 (just for this user)
Can someone help?
Thanks
Rajim
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2006 07:29 AM
тАО06-26-2006 07:29 AM
Re: setting umask value
The developer could just type:
umask 077
At the command prompt.
Developers being developers, you'll need to modify his/her profile.
Start with /etc/profile and then .profile and try to make this statement the last thing that happens when the profile gets sourced.
umask 077
Have a great day.
And ask yourself, what have you done to enable a helpless developer today.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2006 07:31 AM
тАО06-26-2006 07:31 AM
Re: setting umask value
Given:
# cat ./mymask
umask 077
...if you do:
# ./mymask
...then the umask of your current environment will remain *unchanged*.
If you source (read) the script as:
# . ./mymask
...then the changed umask will be propogated and changed in the current environment.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2006 07:42 AM
тАО06-26-2006 07:42 AM
Re: setting umask value
There are really two options:
1) explicitly set umask in .profile
2) His script should be sourced in .profile by using the dot "." operator; sourcing a file makes the file part of the foreground process so that a child process is not involved. This sourced file must not contain an exit or return statement as that would have the effect of exiting the foreground process (the shell in this case).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2006 08:10 AM
тАО06-26-2006 08:10 AM
Re: setting umask value
I tested this. The directory permission are O.K with the new umask 077. But if I touch file in that directory it does not have the same umask
Raji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2006 08:18 AM
тАО06-26-2006 08:18 AM
Re: setting umask value
umask 077
mkdir mynewdir
cd mynewdir
touch mynewfile
ls -l
I suspect that you will find that '.' the local directory has mode 700 (drwx------) and that mynewfile has mode 600 (-rw------) which is entirely consistant with a umask of 077.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2006 08:29 AM
тАО06-26-2006 08:29 AM
SolutionIn order to set the execute bit from within the shell, an explicit chmod is required after the file is created. In other languages (e.g. C,C++, or Perl) a one-step file creation with execute bit set is possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2006 08:39 AM
тАО06-26-2006 08:39 AM
Re: setting umask value
Thanks again