Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 79015 - umask is not working properly - /usr/lib/perl5/5.6.1/i386-linux/auto/POSIX/umask.al
Summary: umask is not working properly - /usr/lib/perl5/5.6.1/i386-linux/auto/POSIX/um...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: perl
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Chip Turner
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-04 16:20 UTC by Andrew Plata
Modified: 2007-04-18 16:48 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-12-18 18:41:28 UTC


Attachments (Terms of Use)

Description Andrew Plata 2002-12-04 16:20:33 UTC
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 18:19:10 UTC
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 18:41:28 UTC
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.