Bug 961348 - /etc/bashrc sets umask based on wrong user number range
/etc/bashrc sets umask based on wrong user number range
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: setup (Show other bugs)
All Linux
unspecified Severity low
: rc
: ---
Assigned To: Ondrej Vasik
Depends On:
  Show dependency treegraph
Reported: 2013-05-09 09:04 EDT by Alain D D Williams
Modified: 2013-05-09 14:51 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-05-09 14:49:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alain D D Williams 2013-05-09 09:04:30 EDT
Description of problem:

/etc/bashrc contains:

    # By default, we want umask to get set. This sets it for non-login shell.
    # Current threshold for system reserved uid/gids is 200
    # You could check uidgid reservation validity in
    # /usr/share/doc/setup-*/uidgid file
    if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
       umask 007
       umask 027

However /etc/login.defs contains:

# Min/max values for automatic uid selection in useradd
UID_MIN			  500

Ie daemon/... users are created with usernumbers greater than 200. Eg uuidd has the usernumber 499.
Comment 2 Ondrej Vasik 2013-05-09 14:49:42 EDT
It is intentional, although it seems to be strange. Before, when the static ID limit was 100, this number was 99, therefore it was increased to 199, as the limit was increased to 200. This is old behaviour - different umask for static system ids and different for the others. 

TBH, I don't know why it was done that way, it is very old stuff. I tend to close it WONTFIX for RHEL. We are actually discussing exactly same thing in Fedora, in #957852. I want to investigate the reasons behind different behaviour for static and dynamic range of system ids before doing any change there.
Comment 3 Ondrej Vasik 2013-05-09 14:51:19 EDT
(please note that UID_MIN is the border of user ids, not the static ids... this is tracked by SYS_UID_MIN in later Fedora, but not in RHEL-6 afaik.

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