LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 09: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, 10:13 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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, 10:23 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Bash creates rw-rw-rw on my system when the umask is 000
 
Old 12-15-2011, 07:49 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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, 08: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, 08:59 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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



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 08:01 AM
umask and /usr/bin/umask linux_user2011 Linux - Newbie 6 04-27-2011 02:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:54 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
Open Source Consulting | Domain Registration