LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   why newly created file permission always 644...umask issue (https://www.linuxquestions.org/questions/linux-security-4/why-newly-created-file-permission-always-644-umask-issue-793520/)

jschiwal 03-13-2010 05:07 AM

You don't subtract a mask. The umask is ANDed with 666 for files. Treat each digit of the octal number separately.

win32sux 03-13-2010 05:23 AM

LOL! Yeah, I can see now why my subtraction-based approach doesn't make any sense at all! After some thought, the results obtained for the 077 umask in the previous posts look fine now. The group and other permissions are eliminated (due to the sevens), and the owner's is left untouched (due to the zero), making for a file with permissions in mode 600.

Apologies to anyone whom I might have confused with my insanely erroneous approach.

Many thanks for setting me straight, jschiwal! :)


All times are GMT -5. The time now is 05:01 PM.