| Author |
Basic umask question.
|
|
| Boulware5 2003-02-08, 12:39 pm |
| One of the most frustrating things is when two certification books give you two different answers. How do you get the deafult permissions from a given umask? One of my books says you subtract it from 777. So let's say we have a umask of 022. 777 - 022 = 755. Then another study guide says you subtract it from 666. So 666 - 022 = 644. AND then the Osborne book says you subtract it from 777, but then it gives a table of default umask's which does not follow that rule. Amazing.... It's like you can't trust what you read in a certification book. So anyway, I just want someone to confirm if you subtract 777 or 666. And also, how do you get directory permisions from a given umask? | |
| ccieToBe 2003-02-08, 12:51 pm |
| Subtract from 777. You could just test this though:
umask 077
touch test
ls -l test | |
| Boulware5 2003-02-08, 1:32 pm |
| I would have tried that but I don't have access to a *nix machine at the moment and I HAD to know right now.  | |
| Boulware5 2003-02-08, 11:41 pm |
| ccie, I just tried it on one of my eggdrop bot shells and it appears it's subtracting from 666 and not 777:
ÀÄ(sf) $ umask
0022
Úݱ²alumapro4²±°Ä(23:34:00)Ä(
~)Ä
ÀÄ(sf) $ touch file
Úݱ²alumapro4²±°Ä(23:34:15)Ä(
~)Ä
ÀÄ(sf) $ ls -l file
-rw-r--r-- 1 sf arghosting 0 Feb 8 23:34 file
If it's 777, 777 - 022 = 755 = -rwx-r-x-r-x which is not the permisions for "file".
Now if I do 666: 666 - 022 = 644 = -rw-r--r-- which it is.
And I have tried this on both a Linux and FreeBSD shell. (just in case it's different for some reason on BSD and Linux) | |
| ccieToBe 2003-02-09, 12:00 am |
| Yeah, I just tested that too. It looks like I was wrong. Subtracting from 666 seems a bit counterintuitive (what happened to the execute bit?) though. Thanks for the info  | |
| Boulware5 2003-02-09, 12:03 am |
| Don't worry.....BOTH of my Linux+ books were wrong about it too.  | |
| masamune 2003-02-09, 12:07 am |
| Boulware I see you confused...
Default permissions on Directories are 777
so if the umask is 022 then perms are 777 - 022 = 755.
Default permissions on files are 666 so if the umask is 022 then perms are 666 - 022 = 744.
Hope this helps  | |
|
|
| masamune 2003-02-09, 12:26 am |
| quote:
But thanks for clearing it up.
You're welcome 
BTW what book to you use to study? | |
| Boulware5 2003-02-09, 12:28 am |
| quote: Originally posted by masamune
You're welcome 
BTW what book to you use to study?
Buncha study guides/tutorials...as for books:
Osborne Linux+ Study Guide (loaded with mistakes)
Linux+ ExamCram (some mistakes but not too many)
I also have "Linux Complete" which I may or may not read through before the test. | |
| masamune 2003-02-11, 4:00 am |
| I'm currently using both 'LPI Linux Certification in a Nutshell' O'Reilly Editions and RHCE Study Guide Second Edition published by Syngress/McGraw Hill as basic learning material.
Man pages of course, LDP and some other web resources..
My preference goes to the first book, which is more CLI oriented than the second
one.
Reading book #2 could give the impression that configuring Linux is just like setting up a Windows box : Linuxconf for this, Linuxconf for that...(sic)
For sure is it a great tool, not suitable for everything.
I prefer to learn it the 'hard', should I
say the right way  | |
|
|
|
|
|
|
|
|
| Boulware5 2003-02-12, 1:48 pm |
| Yeah tohrt... Ive various times complained about all the mistakes cert books have. They sometimes get rushed while sacrificing thorough editing. It's a shame...you can't believe everything you read in them. Have to have a Linux box and try stuff out for yourself...or confirm it with man/info pages. A few of my books have mistakes so blatant, I sometimes wonder if the author knows less than I do.  | |
|
| No kidding Boulware5,
I'm just learning the administration intricacies of Linux and when I can point out some major flaws in some of these publications, to say that is sad is a gross understatement.
Another irritation of mine.
Training courses.
Shoddy or missing content.
Man I feel a flame coming on from someone as I type this. But here goes >
Braindumps -
I'm not an advocate of them to pass a test whatsoever. memorising an answer isn't LEARNING the content or concept.
But -
I find the biggest one I can - Edit the questions to correct syntax - LOOK UP the correct answer - write a short paragraph as to why this answer is correct & note any trip-ups or test trap issues about said question.[ did this with 2000 & ended up with a 500 page document ]LOL
I also got 82% right
I'm not memorizing anything. That doesn't work for me. I have to learn it. I get bored rereading training books. But for some reason I like looking up specific topics so this approach works for me pretty well.
 |
|
|
|