LinuxQuestions.org
Register a domain and help support LQ
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 11-06-2014, 11:55 AM   #1
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 447

Rep: Reputation: 28
This doesnt make sense to me...


Question 9:
Your current unmask is set to 002. If you create a new file, what will the permission of the new file be?
A. ------w-
B. rwxrwx-w-
C. -rw-rw-ró
D. rwxrwxr-x

i chose A...but the answer is b...isnt 0 no permissions???

thanks
 
Old 11-06-2014, 12:14 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,252

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
It works inverted. Bits set in umask will be NOT set in permission of created file (will be masked). So, for ex. 0776 means "no permissions" except "execute" for "others". But I don't think that question is properly formulated, resulting permissions also depends on flags specified during calling "open" function (which create files). And the answer should not be "c" or "d"? 002 means remove "write permission for others" and leave rest as specified on creation file flags.

Last edited by eSelix; 11-18-2014 at 12:33 PM. Reason: Changed invalid 0771 to 0776
 
Old 11-06-2014, 01:10 PM   #3
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,004

Rep: Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620
My understandingis that the above post is correct and the question is incorrect. I await enlightenement from those in the know
 
Old 11-06-2014, 02:39 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248
Quote:
i chose A...but the answer is b...isnt 0 no permissions???
Not with umask where the numbers are the reverse of standard permissions. Brief explanation at the link below:

http://unixhelp.ed.ac.uk/examples/umask.html

http://www.cyberciti.biz/tips/unders...lue-usage.html
 
Old 11-06-2014, 02:46 PM   #5
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,004

Rep: Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620
Quote:
Originally Posted by yancek View Post
Not with umask where the numbers are the reverse of standard permissions. Brief explanation at the link below:

http://unixhelp.ed.ac.uk/examples/umask.html

http://www.cyberciti.biz/tips/unders...lue-usage.html
I will be bold, and probably wrong, but how abouyt the objections raised above?
 
Old 11-06-2014, 03:39 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,087
Blog Entries: 10

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Umask of 002 is I thought the most typical default and that would lead to permissions of 775 which would be answer (d).
 
  


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
Does this make sense? Linux_Kidd Linux - Networking 3 05-31-2013 09:03 AM
[SOLVED] SSH - scp permission denied, doesnt make sense vendtagain Linux - Networking 8 10-13-2009 06:00 PM
irc dcc send problem which doesnt make sense rastiazul Linux - Networking 0 11-14-2008 09:02 PM
How does this make sense? Trinity22 Linux - General 2 03-30-2005 01:45 AM
Ya sure this make sense Edward78 General 2 09-23-2003 04:00 PM


All times are GMT -5. The time now is 04:28 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