LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-23-2007, 01:52 PM   #1
libin88
LQ Newbie
 
Registered: Jul 2005
Posts: 20

Rep: Reputation: 0
Post umask not working


My umask setting is 0077, see below

[root@server ~]# umask
0077

the permission of the new file suppose to be
-rw-------

but what I got is
-rw-rw-rw-

No matter how I change the umask setting (0000, 0011, 0700 etc.), the file permission I got is always -rw-rw-rw-.

Do you know what is wrong with my umask, and how to fix it?

Thank you very much!
 
Old 08-23-2007, 02:20 PM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Hi.

That's a bit odd. What type of filesystem are you doing this on? Is it FAT32 by any chance?

If not, try:
Code:
pwd
umask
touch wibble
ls -l wibble
and post the output.

Dave
 
Old 08-23-2007, 02:20 PM   #3
lakris
Member
 
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102

Rep: Reputation: 15
Well it seems to work for me...
Quote:
lakris@ubuntu:~$ umask
0022
lakris@ubuntu:~$ >testfile
lakris@ubuntu:~$ ls -l testfile
-rw-r--r-- 1 lakris lakris 0 2007-08-23 21:16 testfile
lakris@ubuntu:~$ umask 0077
lakris@ubuntu:~$ umask
0077
lakris@ubuntu:~$ rm testfile
lakris@ubuntu:~$ >testfile
lakris@ubuntu:~$ ls -l testfile
-rw------- 1 lakris lakris 0 2007-08-23 21:17 testfile
Try to remove the file first (it may retain the permissions it had when it was created)
 
Old 08-23-2007, 02:55 PM   #4
libin88
LQ Newbie
 
Registered: Jul 2005
Posts: 20

Original Poster
Rep: Reputation: 0
My file system is Linux EXT3.

[root@server ~]# pwd
/root

[root@server ~]# umask
0022

[root@server ~]# touch wibble
[root@server ~]# ls -l wibble
-rw-rw-rw- 1 root root 0 Aug 23 15:54 wibble
 
Old 08-23-2007, 03:17 PM   #5
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
I am completely stumped. Anyone else?
 
Old 08-23-2007, 03:17 PM   #6
lakris
Member
 
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102

Rep: Reputation: 15
did you try to remove the file (or touch a new one) ?
Quote:
root@ubuntu:~# umask
0022
root@ubuntu:~# touch shit1
root@ubuntu:~# ls -la shit1
-rw-r--r-- 1 root root 0 2007-08-23 22:18 shit1
root@ubuntu:~# umask 0077
root@ubuntu:~# touch shit1
root@ubuntu:~# ls -la shit1
-rw-r--r-- 1 root root 0 2007-08-23 22:18 shit1
root@ubuntu:~# rm shit1
root@ubuntu:~# touch shit1
root@ubuntu:~# ls -la shit1
-rw------- 1 root root 0 2007-08-23 22:18 shit1

Last edited by lakris; 08-23-2007 at 03:19 PM.
 
Old 08-23-2007, 03:45 PM   #7
libin88
LQ Newbie
 
Registered: Jul 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lakris View Post
did you try to remove the file (or touch a new one) ?
Yes, I DID.
 
Old 08-23-2007, 03:52 PM   #8
lakris
Member
 
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102

Rep: Reputation: 15
I'm not sure if this is possible but does the directory have any sticky bits set?
 
Old 08-23-2007, 04:00 PM   #9
libin88
LQ Newbie
 
Registered: Jul 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lakris View Post
I'm not sure if this is possible but does the directory have any sticky bits set?
Not sure what is sticky bits set. How to check that?
 
Old 08-23-2007, 04:02 PM   #10
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,508
Blog Entries: 2

Rep: Reputation: 68
Quote:
Originally Posted by libin88 View Post
My file system is Linux EXT3.

[root@server ~]# pwd
/root

[root@server ~]# umask
0022

[root@server ~]# touch wibble
[root@server ~]# ls -l wibble
-rw-rw-rw- 1 root root 0 Aug 23 15:54 wibble
Based on above, your umask is 0022, not 0077 as you told us.
Please, check.
 
Old 08-23-2007, 04:08 PM   #11
libin88
LQ Newbie
 
Registered: Jul 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by marozsas View Post
Based on above, your umask is 0022, not 0077 as you told us.
Please, check.
It doesn't matter, no matter my umask is, my file permission is always
-rw-rw-rw-
 
Old 08-23-2007, 04:14 PM   #12
lakris
Member
 
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102

Rep: Reputation: 15
Quote:
Originally Posted by libin88 View Post
Not sure what is sticky bits set. How to check that?
Quote:
lakris@ubuntu:~$ ls -l -d .
drwxr-xr-x 88 lakris lakris 12288 2007-08-23 22:48 .
lakris@ubuntu:~$
I don't remember exactly but do You have a t in there instead of x (for group or all)?
The directory isn't by any chance controlled by samba?
What is your shell?

I think this is intriguing!
 
Old 08-23-2007, 04:24 PM   #13
libin88
LQ Newbie
 
Registered: Jul 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lakris View Post
I don't remember exactly but do You have a t in there instead of x (for group or all)?
The directory isn't by any chance controlled by samba?
What is your shell?

I think this is intriguing!
NO, there is no t for both group and all. My machine is not using samba either. I am using bash shell.
 
Old 08-23-2007, 04:29 PM   #14
libin88
LQ Newbie
 
Registered: Jul 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Is there way I can re-install umask? I am using FC6.
 
Old 08-23-2007, 04:33 PM   #15
lakris
Member
 
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102

Rep: Reputation: 15
Can You do the following commands:
Quote:
lakris@ubuntu:~$ umask -p
umask 0022
lakris@ubuntu:~$ umask -S
u=rwx,g=rx,o=rx
lakris@ubuntu:~$ umask 0077
lakris@ubuntu:~$ umask -p
umask 0077
lakris@ubuntu:~$ umask -S
u=rwx,g=,o=
lakris@ubuntu:~$
What is Your output?
and what does Your /etc/profile say?

Last edited by lakris; 08-23-2007 at 04:41 PM.
 
  


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
When and why to use Umask ? tofee Linux - Newbie 4 11-26-2009 09:21 AM
Umask metallica1973 Linux - Software 4 11-27-2005 01:21 PM
Umask in .bash_profile stopped working mariusak Linux - Newbie 5 06-03-2005 08:05 AM
umask trophy Linux - General 1 04-03-2004 01:17 AM
vsftpd umask not working k-bot Linux - Software 1 03-10-2004 04:29 PM

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

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