- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: PUNKED BY 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
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-07-2007 06:38 AM
03-07-2007 06:38 AM
PUNKED BY UMASK
millsm@ngbva (/home/millsm)$umask
022
millsm@ngbva (/home/millsm)$umask -S
u=rwx,g=rx,o=rx
millsm@ngbva (/home/millsm)$> test
millsm@ngbva (/home/millsm)$ll test
-rw-rw-r-- 1 comp comp 0 Mar 7 14:32 test
comp@ngbva (/comp)$umask -S
u=rwx,g=rx,o=rx
comp@ngbva (/comp)$umask
022
comp@ngbva (/comp)$> test
comp@ngbva (/comp)$ll test
-rw-r--r-- 1 comp comp 0 Mar 7 14:20 test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 06:44 AM
03-07-2007 06:44 AM
Re: PUNKED BY UMASK
rm both files first and repeat your test.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 06:46 AM
03-07-2007 06:46 AM
Re: PUNKED BY UMASK
This could easily be explained if your file already existed. The redirection simply truncates (sets the file's end-of-file pointer) to the beginning but does nothing to the permissions.
Consider:
# cd /tmp
# umask 022
# touch me
# ls -l me
-rw-r--r-- 1 root sys 0 Mar 7 14:44 me
# chmod 664 me
# ls -l me
-rw-rw-r-- 1 root sys 0 Mar 7 14:44 me
# > me
# ls -l me
-rw-rw-r-- 1 root sys 0 Mar 7 14:45 me
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 06:46 AM
03-07-2007 06:46 AM
Re: PUNKED BY UMASK
ll -d /comp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 07:07 AM
03-07-2007 07:07 AM
Re: PUNKED BY UMASK
This is the output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 07:26 AM
03-07-2007 07:26 AM
Re: PUNKED BY UMASK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 07:40 AM
03-07-2007 07:40 AM
Re: PUNKED BY UMASK
> if you write over a file it gets differnt permissions... this is crazy... why?
The redirection operator ('>') _truncates_ and existing file. That is, the file's end-of-file pointer is set to offset-0 (as if nothing had been written). The existing file is not removed and hence no permission bits are setup as when a file is created.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 07:44 AM
03-07-2007 07:44 AM
Re: PUNKED BY UMASK
Try re-running your test, but make sure you remove the 'test' file BEFORE doing the '> test'. I think you will see the results you are expecting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 07:54 AM
03-07-2007 07:54 AM
Re: PUNKED BY UMASK
It's not crazy; it's behaving exactly as documented. It's crazy to assume that the shell behaves as you expect rather than how it is documented.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 08:26 AM
03-07-2007 08:26 AM
Re: PUNKED BY UMASK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 08:34 AM
03-07-2007 08:34 AM
Re: PUNKED BY UMASK
Welcome, as a new member to the community. If you haven't already, please see:
http://forums1.itrc.hp.com/service/forums/helptips.do?#28
Regards!
...JRF...