LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-14-2011, 10:48 AM   #1
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
Question Umask didn't do it's job...


Hello!
I have umask set in /etc/profile to "000". But I get new files onto my HDD with permissions such as "-rw-r--r--". For example it's my recent file downloaded from torrents. How come it's not "-rw-rw-rw-"?
 
Old 12-14-2011, 11:13 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,967

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
The umask only subtracts from the permission bits that the application requests. If the application requests "rw-r--r--", that's the most you will ever see.
 
Old 12-14-2011, 11:23 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Bash creates rw-rw-rw on my system when the umask is 000
 
Old 12-15-2011, 08:49 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,967

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
Quote:
Originally Posted by Mr. Alex View Post
For example it's my recent file downloaded from torrents.
The file was created by your bittorrent client, which probably set the permissions the file had on the original seed. Bash had nothing to do with it.
 
Old 12-15-2011, 09:33 AM   #5
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Original Poster
Rep: Reputation: Disabled
Tried several files from torrents - all with same permissions. I really don't think all those seeds have *nix operating systems. My guess is that any Linux program can have it's own default file permissions and doesn't take your system umask (it's up to program which umask to use).
 
Old 12-15-2011, 09:59 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by Mr. Alex View Post
Tried several files from torrents - all with same permissions. I really don't think all those seeds have *nix operating systems. My guess is that any Linux program can have it's own default file permissions and doesn't take your system umask (it's up to program which umask to use).
The way it works is that the torrent program creates the file using the creat (that's right - no final e) or open system call specifying the permissions in the mode argument. The system will subtract any requested bits "masked out" by the current umask setting (none if the umask is 000).

More information in the creat man page.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
umask and permissions: has umask 007 bad side effects? browny_amiga Linux - General 2 09-09-2011 09:01 AM
umask and /usr/bin/umask linux_user2011 Linux - Newbie 6 04-27-2011 03:05 AM


All times are GMT -5. The time now is 09:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration