Bug 749253

Summary: nfs-utils does not change nfsnobody's primary group when the package is upgraded on 64Bit
Product: Red Hat Enterprise Linux 5 Reporter: monte_olvera
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.7CC: benglish, jlayton, rdassen, simon.matter, syeghiay, yanwang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-17 18:38:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 807971    

Description monte_olvera 2011-10-26 15:03:08 UTC
Description of problem:

nfs-utils (1.0.9-54) does not change nfsnobody's primary group from 4294967294 to 65534 when the package is upgraded on 64Bit rhel 4/5.  It changes the /etc/group entry to 65534 but does not change the user's gid in /etc/passwd.

After an upgrade to nfs-utils-1.0.9-54:
# grep nfsnobody /etc/passwd /etc/group
/etc/passwd:nfsnobody:x:65534:4294967294:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
/etc/group:nfsnobody:x:65534:


From the scripts being run in the rpm:
#rpm -qa --scripts nfs-utils
... <snip>
# Using the 16-bit value of -2 for the nfsnobody uid and gid

# Create nfsnobody gid as long as it does not already exist.
cat /etc/group | cut -d':' -f 1 | grep --quiet nfsnobody 2>/dev/null
if [ "$?" -eq 1 ]; then
    /usr/sbin/groupadd -g 65534 nfsnobody 2>/dev/null || :
else
    /usr/sbin/groupmod -g 65534 nfsnobody 2>/dev/null || :
fi

# Create nfsnobody uid as long as it does not already exist.
cat /etc/passwd | cut -d':' -f 1 | grep --quiet nfsnobody 2>/dev/null
if [ "$?" -eq 1 ]; then
        /usr/sbin/useradd -l -c "Anonymous NFS User" -r -g 65534 \
                -s /sbin/nologin -u 65534 -d /var/lib/nfs nfsnobody 2>/dev/null || :
else
        /usr/sbin/usermod -u 65534 nfsnobody 2>/dev/null || :
fi
... <snip>



This correction should be made:
    /usr/sbin/usermod -u 65534 nfsnobody 2>/dev/null || :
should be changed to this
    /usr/sbin/usermod -u 65534 -g 65534 nfsnobody 2>/dev/null || :


Version-Release number of selected component (if applicable):
  on rhel 4 and 5 64Bit architectures

How reproducible:
  every time

Steps to Reproduce:
1.  Have a previous version (any prior to 1.0.9-54?) of nfs-utils installed on
    64Bit rhel 4/5 
2.  Upgrade nfs-utils
  
Actual results:
# grep nfsnobody /etc/passwd /etc/group
/etc/passwd:nfsnobody:x:65534:4294967294:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
/etc/group:nfsnobody:x:65534:

Expected results:
# grep nfsnobody /etc/passwd /etc/group
/etc/passwd:nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
/etc/group:nfsnobody:x:65534:


Additional info:
will provide if requested.

Comment 1 Steve Dickson 2011-12-08 15:01:26 UTC
This looks similar to this 
https://bugzilla.redhat.com/show_bug.cgi?id=746948

Comment 2 Steve Dickson 2011-12-09 13:24:09 UTC
*** Bug 746948 has been marked as a duplicate of this bug. ***

Comment 6 Steve Dickson 2012-03-09 20:48:13 UTC
I believe this was fixed by 
    https://bugzilla.redhat.com/show_bug.cgi?id=710020

Try using the -60 nfs-utils

Comment 7 RHEL Program Management 2012-04-02 10:24:04 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.