HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: umask not preserved - a FORTRAN issue?
Operating System - HP-UX
1837004
Members
1823
Online
110111
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-24-2004 09:21 AM
05-24-2004 09:21 AM
umask not preserved - a FORTRAN issue?
How could the execution of an HP-UX script file via a FORTRAN program not preserve an account's umask value?
For example, I have a HP-UX script that, when executed manually, produces a log file with the ">>" command. The log file has the expected permissions of 644 (the umask has been set to 022 in the account's .profile).
However, when the same HP-UX script is executed from a FORTRAN program under the same account, the log file produced has the default permissions 666. For troubleshooting purposes I modified the script to write out the umask and when run via FORTRAN program, it is reported as 00.
Even if the FORTRAN program uses a FORK and a child process to run the script, what I've learned about FORK is that it should preserve the umask.
I apologize for rather vague references to "A FORTRAN Program", but speaking theoretically - what might cause the umask set in the .profile of an account to be wiped out? I appreciate any help.
For example, I have a HP-UX script that, when executed manually, produces a log file with the ">>" command. The log file has the expected permissions of 644 (the umask has been set to 022 in the account's .profile).
However, when the same HP-UX script is executed from a FORTRAN program under the same account, the log file produced has the default permissions 666. For troubleshooting purposes I modified the script to write out the umask and when run via FORTRAN program, it is reported as 00.
Even if the FORTRAN program uses a FORK and a child process to run the script, what I've learned about FORK is that it should preserve the umask.
I apologize for rather vague references to "A FORTRAN Program", but speaking theoretically - what might cause the umask set in the .profile of an account to be wiped out? I appreciate any help.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2004 09:27 AM
05-24-2004 09:27 AM
Re: umask not preserved - a FORTRAN issue?
I don't know what could cause the issue, but if you want to make sure the file gets created with 644 permissions, you could put a 'umask 022' statement in the script that is being called by the Fortran program.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2004 09:42 AM
05-24-2004 09:42 AM
Re: umask not preserved - a FORTRAN issue?
Ah, but you are making the assumption that the FORTRAN program doesn't do a umask(0000) itself before doing an open() or creat() system call.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2004 01:59 PM
05-24-2004 01:59 PM
Re: umask not preserved - a FORTRAN issue?
Since it does appear that the FORTRAN program does a umask(0000) before the system() function that invokes your shell shell, an explicit umask 022 in your script should solve the problem. Because the shell is executed as a child process in the system() function, umask will still remain 0000 in the parent FORTRAN process but nevertheless if the file is actually created via your script, the script's umask will prevail.
Note that ">>" will not affect the mode of the file if the file already exists.
Note that ">>" will not affect the mode of the file if the file already exists.
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP