The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages 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 05:34 PM
help with file permissions bbbngowc Security 3 12-21-2007 01:34 PM
File permissions beginner1 UNIX for Dummies Questions & Answers 5 04-12-2006 12:56 PM
file permissions mohanprabu Shell Programming and Scripting 4 05-31-2005 09:19 AM
File and Dir permissions thomas.jones UNIX for Dummies Questions & Answers 11 04-19-2002 09:35 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 4.00 average. Display Modes
  #1 (permalink)  
Old 11-15-2005
ranj@chn ranj@chn is offline Forum Advisor  
Playing with Ubuntu Now!
  
 

Join Date: Oct 2005
Location: Chennai
Posts: 365
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
  #2 (permalink)  
Old 11-15-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
Some Light
  #3 (permalink)  
Old 11-15-2005
ranj@chn ranj@chn is offline Forum Advisor  
Playing with Ubuntu Now!
  
 

Join Date: Oct 2005
Location: Chennai
Posts: 365
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???
  #4 (permalink)  
Old 11-15-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
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
#
  #5 (permalink)  
Old 11-16-2005
ranj@chn ranj@chn is offline Forum Advisor  
Playing with Ubuntu Now!
  
 

Join Date: Oct 2005
Location: Chennai
Posts: 365
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.
  #6 (permalink)  
Old 11-16-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
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.
  #7 (permalink)  
Old 11-16-2005
dangral dangral is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2002
Posts: 699
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:16 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0