- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Setting umask using environment variable - not a s...
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
03-22-2012 01:35 PM
03-22-2012 01:35 PM
Hi,
HP-UX usxsl022 B.11.31 U ia64 0309084507 unlimited-user license
I was wondering if it is possible to set the umask by setting an environment variable. I was told on a different forum that some flavors of unix/linux allowed the following:
UMASK=022
Will this work on HP Unix ?
I need this because we use apache and webspeed from Progress, which is basically our web transaction server. The webspeed process runs under a user id, and it creates files with permissions rw-rw-rw. This is not acceptable, and I need to apply umask 022 to meet some security standard we have.
Thanks,
Etienne.
Solved! Go to Solution.
- Tags:
- umask
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2012 03:31 PM
03-22-2012 03:31 PM
SolutionUmask is fundamentally not an environment variable, though it is explicitly inherited from the parent process to the child just like (exported) environment variables (see fork(2)).
The ability to set it using an environment variable syntax would probably be a feature of a specific shell, implemented by running the umask() system call as the user or a script assigns a value to a specific variable.
Are you sure your Progress is started with the correct umask? If it is started directly from /etc/inittab, it would probably inherit the kernel default umask, which has historically been 000 in HP-UX. Even if Progress is programmed to explicitly chmod() the files it creates to sane values, it might still allow its child processes to inherit the original unmodified value.
If you find no other way to configure the umask for webspeed, you might find the actual webspeed binary, rename it, and write a tiny shell script in its place. For example, if the original webspeed binary was /some/where/webspeed, you might do this:
mv /some/where/webspeed /some/where/webspeed.real vi /some/where/webspeed
<write the script as below>
chmod 755 /some/where/webspeed
The script /some/where/webspeed would be:
#!/bin/sh umask 022 exec /some/where/webspeed.real "$@"
The "exec" command will make the shell process replace itself with the real webspeed binary, so there will be no extra shell process cluttering the ps listing. And the "$@" syntax will pass all the command line parameters given to this webspeed script to the webspeed.real binary exactly as they were, even if they contain spaces or special characters.
If this kind of script does not help, it probably means webspeed is explicitly setting its own umask: in that case, it's time to read the webspeed documentation to find out how it decides the value it sets for itself. In such a case, it will probably be settable in some configuration file, but leaving it unset might cause it to default to 000.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2012 07:08 AM
03-23-2012 07:08 AM
Re: Setting umask using environment variable - not a system call
Thanks for your reply ! As you said ultimately this might be configuration on the webspeed application. I was not able to locate documentation about this topic.
I have simply logged a support case Progress about this issue.
Your suggestion to locate where the actual application is launched and apply umask would most likely work! After drilling down I was able to locate the actual executable. This will be considered a last resort change by our DBA, as the policy is to avoid customizations to files in the installation directories of apps we have purchased.
We could probably use a wrapper script or something of the sort.
Thanks,
Etienne.