Bug 1300533

Summary: An existing 'rpc' user is removed during the installation of rpcbind without any messages
Product: Red Hat Enterprise Linux 6 Reporter: Masahiro Matsuya <mmatsuya>
Component: rpcbindAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: dwysocha, eguan, yoyang
Target Milestone: rcKeywords: Patch, Reproducer
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rpcbind-0.2.0-13.el6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1301288 1321279 (view as bug list) Environment:
Last Closed: 2017-03-21 12:04:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1269194, 1301288, 1321279    

Description Masahiro Matsuya 2016-01-21 05:25:16 UTC
Description of problem:

A customer had a 'rpc' user (not UID=32) on the system, but the existing 'rpc' user was deleted by the installation of rpcbind package without any message.

We found a fedora documentation about packaging, and it says that any user account should not be deleted during the package installation.

https://fedoraproject.org/wiki/Packaging:UsersAndGroups?rd=Packaging/UsersAndGroups

In rpcbind.spec:
----------------------------------
%pre

# Check the validity of the rpc uid and gid.
# If they don't exist, create them
# If they exist but are the wrong value, remove them 
#   and recreate them with the correct value
# If they exist and are the correct value do nothing
rpcid=`getent passwd rpc | cut -d: -f 3`
if [ -n "$rpcid" -a "$rpcid" != "32" ]; then
        /usr/sbin/userdel  rpc 2> /dev/null || :
        /usr/sbin/groupdel rpc 2> /dev/null || :
fi
if [ -z "$rpcid" -o "$rpcid" != "32" ]; then
        /usr/sbin/groupadd -o -g 32 rpc > /dev/null 2>&1
        /usr/sbin/useradd -o -l -c "Rpcbind Daemon" -d /var/cache/rpcbind -g 32 \
        -M -s /sbin/nologin -u 32 rpc > /dev/null 2>&1
fi
----------------------------------

It forces to have the 'rpc' account with UID=32. If the UID is not 32, it removes it and create another 'rpc' account with UID=32.

If the above fedora documentation is correct, it should not remove the existing 'rpc' account during the installation. 

As an example of another package, 'httpd' also creates a user account 'apache'.
But, if the user account 'apache' exists, it never remove the existing account.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 6

Comment 6 Yongcheng Yang 2016-11-14 09:45:12 UTC
Moving to VERIFIED as Comment #5.

And will include this automatic case as regression test in future.

Comment 8 errata-xmlrpc 2017-03-21 12:04:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0799.html