Bug 79015 - umask is not working properly - /usr/lib/perl5/5.6.1/i386-linux/auto/POSIX/umask.al
umask is not working properly - /usr/lib/perl5/5.6.1/i386-linux/auto/POSIX/um...
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: perl (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Chip Turner
David Lawrence
: Security
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-04 11:20 EST by Andrew Plata
Modified: 2007-04-18 12:48 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-12-18 13:41:28 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andrew Plata 2002-12-04 11:20:33 EST
Description of Problem:

When I run the umask command as root the output is 0022 but when I create a file
as root the permissions are -rw-r--r--. Based on the documentation I have read
the permissions should be -rwx-rx-rx based on that umask.
Also, when I run the umask command as aplata (my user login) the output is 0002
but when I create a file the permissions are -rw-rw-r--. Shouldn't it be
-rwx-rwx-rx based on that umask? I'm confused. The strange thing is when I run
umask -S the output displayed is what I think the file permissions should be. So
why dosen't the shell create my file with the proper permissions? I also set the
umask for all users in the /etc/profile and I still get the same thing.

Another thing I noticed is that when I set the umask to 002 in root's
.bash_profile and restarted .bash_profile for root the umask would change to
0002 only if I logged in as root in text mode by hitting CTRL+ALT+F1 but would
not change when using Konsole in KDE and remained at 0022. What I mentioned in
the first paragraph also remained the same.

Your help is much appreciated.


Version-Release number of selected component (if applicable):

/usr/lib/perl5/5.6.1/i386-linux/auto/POSIX/umask.al

How Reproducible:


Steps to Reproduce:
1. edit /etc/profile to add umask of 002 or add umask 002 to Root's .bash_profile.
2. restart computer or restart .bash_profile if Root. 
3. create file using touch filename as user or as Root.

Actual Results:

File permissions are rw-rw-r-- when file is created.
(If done as Root you will only see this if logged into text mode)

Expected Results:
As the user or Root the permissions should be u=rwx,g=rwx,o=rx

Additional Information:

When replying back to me can you please CC: aplata@libertyrms.info
Comment 1 Miloslav Trmac 2002-12-05 13:19:10 EST
Nothing in this "bug" AFAICS relates to perl.
Anyhow, if you want to know how umask works, see
 man creat
 man 2 mkdir
etc. In short, the umask is a *mask* of what is specified by the program that
creates the file. So if the program tells not to set --x--x--x, it won't be.
Comment 2 Alan Cox 2002-12-18 13:41:28 EST
Not a bug

The umask is applied to the permissions the program requests. Perl like most
apps says create with rw-rw-rw  and the umask turns it to rw-rw----

Alan

Note You need to log in before you can comment on or make changes to this bug.