- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- file permissions (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
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
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-31-2010 02:53 PM
тАО05-31-2010 02:53 PM
i have the problem whe generate file.
the user dbeadm generate flie new wiht permissions 660. i need generate the new file wiht 770.
the file system where generate file is NFS.
how cant generate new flie wiht permissions 770?
change umask user dbeadm?
add line command in the .profile?
thanks for you comments....
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2010 03:02 PM
тАО05-31-2010 03:02 PM
SolutionYou can not, unless you are copying a file with that permission. By default, only directories can be created with execute permission. Otherwise only ld creates files with execute permission. All others must be changed with chmod(1).
>how can generate new file with permissions 770?
Why would you want files created that way? The only files like that would be scripts and it is better if you deliberately use chmod to make sure that's what you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2010 03:08 PM
тАО05-31-2010 03:08 PM
Re: file permissions (umask)
exist document for HP where specify what you say?
The NFS is other operation system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2010 03:34 PM
тАО05-31-2010 03:34 PM
Re: file permissions (umask)
You do NOT want every file to have 770 permission. 660 is the proper permission for all files *except* for scripts. Making every file 770 means that typing the name of the file will cause the shell to run it as a script even when it contains data and this could create a big problem.
If you are writing a script, you save the file along with the interpreter line (first line in the script) and then change the permission to 770 for that one script.
If you have read where permission problems are solved by changing everything to 777, please scrap that book and get a quality book on Unix and shells.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2010 04:06 PM
тАО05-31-2010 04:06 PM
Re: file permissions (umask)
> exist document for HP where specify what you say?
In addition to looking at the 'umask(1)' manpages as suggested, look at the manpages for the 'creat(2)' system call. This is where the 'mode' is given if you look at the code that creates a file (or directory). As already stated, for files, most programs (including the shell) use 0666 as the mode's value. This parameter determines the "most liberal" permission bits. It is to this initial value that the process's 'umask' is applied when the process goes to create a file. With a 'umask' of 000 the file thus created has permissions of 0666 too. Unless you would modify the source code and recompile the binary executable, you're stuck with this default.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2010 04:37 PM
тАО05-31-2010 04:37 PM
Re: file permissions (umask)
>>and umask subtracts permission, for example,
>>umask 002 means file will have 660
>>permissions when created.
I'm sure just a typo by Bill, but 666 - umask 002 = 664 permissions.
To yield 660 permissions you would need a umask of 006.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2010 05:15 PM
тАО05-31-2010 05:15 PM
Re: file permissions (umask)
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2010 09:55 PM
тАО05-31-2010 09:55 PM
Re: file permissions (umask)
Other than umask(1) and creat(2) I don't think there is any documentation saying that the creat(2) default mode is 0666 for files and 0x777 for directories. This is just a UNIX convention.
In C++ iostreams, you can actually see the default value expressed as 0666.
A previous thread with a similar request:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1275381913104+28353475&threadId=1006891
>Patrick: but 666 - umask 002 = 664
Or use:
typeset -i8 x=$(( 8#666 & ! 8#002 )); echo $x
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2010 10:06 PM
тАО05-31-2010 10:06 PM
Re: file permissions (umask)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2010 02:25 AM
тАО06-01-2010 02:25 AM
Re: file permissions (umask)
only in the manual and create umask?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2010 04:07 AM
тАО06-01-2010 04:07 AM
Re: file permissions (umask)
>> only in the manual and create umask?
HP documents? Where do you think the man pages came from? Do you see this line:
Hewlett-Packard Company - 1 - HP-UX 11i Version 3 Feb 2007
on all the manpages? If you want to buy a book, get copies of Marty Poniatowski's books on HP-UX, or read this manual:
http://docs.hp.com/en/B2355-90164/ch07s08.html
This isn't something unique to HP-UX. I am not aware of any version of Unix that does not follow these rules for files and umask.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2010 04:08 AM
тАО06-01-2010 04:08 AM
Re: file permissions (umask)
> but no HP documents where you clarify?
only in the manual and create umask?
What's wrong with the *HP-UX* manpages for 'creat(2)' and for 'umask(1)'? The behavior is ubiquitous to Unix.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2010 10:04 AM
тАО06-01-2010 10:04 AM
Re: file permissions (umask)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2010 10:18 AM
тАО06-01-2010 10:18 AM
Re: file permissions (umask)
Yes but it's not obvious where to find a statement that EVERY command uses 666 to create new files.