LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-13-2010, 05:07 AM   #16
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682

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

Last edited by jschiwal; 03-13-2010 at 05:11 AM.
 
1 members found this post helpful.
Old 03-13-2010, 05:23 AM   #17
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
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!

Last edited by win32sux; 03-13-2010 at 05:49 AM.
 
  


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
cp: cannot stat: Permission denied, even though file is 644? grayFalcon Linux - Newbie 3 10-05-2009 02:40 AM
Group write access for newly created files/directories without changing umask fhd Linux - Security 3 04-05-2009 05:28 AM
Is there any other way of finding out if my file is just modified or is newly created deepti Linux - General 3 01-07-2009 10:35 PM
FTP, newly created files permission georgiozoze Linux - Newbie 2 09-16-2006 08:47 PM
Make newly created file executable Black Chaos Linux - General 3 08-03-2006 10:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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