LinuxQuestions.org
Review your favorite Linux distribution.
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 11-06-2014, 10:55 AM   #1
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 508

Rep: Reputation: 29
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, 11:14 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
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 11:33 AM. Reason: Changed invalid 0771 to 0776
 
Old 11-06-2014, 12:10 PM   #3
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
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, 01:39 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,502

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
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, 01:46 PM   #5
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
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, 02:39 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

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


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

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

All times are GMT -5. The time now is 02:22 AM.

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