The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
To give the "unzip" permissions & "create" file permissions Mike1234 HP-UX 3 03-02-2008 02:34 PM
help with file permissions bbbngowc Security 3 12-21-2007 10:34 AM
File permissions beginner1 UNIX for Dummies Questions & Answers 5 04-12-2006 09:56 AM
file permissions mohanprabu Shell Programming and Scripting 4 05-31-2005 06:19 AM
File and Dir permissions thomas.jones UNIX for Dummies Questions & Answers 11 04-19-2002 06:35 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-14-2005
Playing with Ubuntu Now!
 

Join Date: Oct 2005
Location: Chennai
Posts: 364
Unhappy file permissions

Hi all,

My UNIX box is HP UX - 11.11.

I have got a basic doubt. What are the global permissions for a file and directory?
I set the mask as 111 in my .profile. When I create a new file, it gets created withe -rw-rw-rw- permissions. A directory is created with drw-rw-rw- permissions. So, i thought the global permissions were 777 for both file and directory.
I changed the mask to 002. Now the file got created with -rw-rw-r-- permission and the directory with drwxrwxr-x. Does this mean the file has global permissions of 666 and directory - 777 and setting umask as 111 is not going to alter the global permissions of files being created.

It would be helpful if someone could throw some light on this.

Thanka,
Ranjith
Reply With Quote
Forum Sponsor
  #2  
Old 11-15-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
Some Light
Reply With Quote
  #3  
Old 11-15-2005
Playing with Ubuntu Now!
 

Join Date: Oct 2005
Location: Chennai
Posts: 364
that was very useful

Thanks for the link, Perderabo. It was very useful. But one doubt I still have in my case is that even after setting 'umask 022'; I am getting a file with -rw-rw-rw- permissions. I thought I should get -rwxr-xr-x.
AM I saying something wrong???
Reply With Quote
  #4  
Old 11-15-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
You still have it wrong. Reread that article. You should not get what say you expect nor what you say that you get. I get the expected result:

Code:
#
# uname -svr
HP-UX B.11.11 U
# rm testfile
rm: testfile non-existent
# umask 0
# touch testfile
# ls -l testfile
-rw-rw-rw-   1 root       sys              0 Nov 15 11:28 testfile
# rm testfile
# umask 022
# touch testfile
# ls -l testfile
-rw-r--r--   1 root       sys              0 Nov 15 11:29 testfile
#
Reply With Quote
  #5  
Old 11-16-2005
Playing with Ubuntu Now!
 

Join Date: Oct 2005
Location: Chennai
Posts: 364
mistake done

Sorry Perderabo, I posted it wrong and didnt even check that. Well I get the same permissions.
One last question. From what I could interpret, setting - umask 111 will give 666 permissions to all files created.
Setting umask 000 will also give 666 permission to all files created. I hope that is correct. Pls correct me if I have got it wrong.
Thanks a lot for your patience.
Reply With Quote
  #6  
Old 11-16-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
You still have it wrong. That link represented my best effort to explain the permissions. I put a lot of time into that and since it is not working for you I must give up.
Reply With Quote
  #7  
Old 11-16-2005
Registered User
 

Join Date: Oct 2002
Posts: 676
From Perderabo's handy permissions thread:

Quote:
You can do a "umask 0" to let the program do what it wants as it creates programs
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:32 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0