RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1972133 - [RHEL-9.0] rpcbind: Wrong directory path specified for rpc user
Summary: [RHEL-9.0] rpcbind: Wrong directory path specified for rpc user
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: rpcbind
Version: 9.0
Hardware: All
OS: Linux
high
medium
Target Milestone: beta
: ---
Assignee: Steve Dickson
QA Contact: Yongcheng Yang
URL:
Whiteboard:
Depends On: 1628901
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-15 10:13 UTC by Yongcheng Yang
Modified: 2021-12-07 21:32 UTC (History)
5 users (show)

Fixed In Version: rpcbind-1.2.6-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1628901
Environment:
Last Closed: 2021-12-07 21:30:47 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)

Description Yongcheng Yang 2021-06-15 10:13:36 UTC
[root@rhel-9-latest ~]# rpm -q rpcbind
rpcbind-1.2.5-5.rc1.el9.5.x86_64
[root@rhel-9-latest ~]# id rpc
uid=32(rpc) gid=32(rpc) groups=32(rpc)
[root@rhel-9-latest ~]# grep rpc /etc/passwd
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
[root@rhel-9-latest ~]# ls /var/lib/rpcbind
ls: cannot access '/var/lib/rpcbind': No such file or directory  <<<<
[root@rhel-9-latest ~]#

+++ This bug was initially created as a clone of Bug #1628901 +++

I just found the same problem in RHEL8 while RHEL7 can work correctly.

[root@ibm-x3650m4-01-vm-03 ~]# rpm -q rpcbind
rpcbind-1.2.5-0.el8.x86_64
[root@ibm-x3650m4-01-vm-03 ~]# id rpc
uid=32(rpc) gid=32(rpc) groups=32(rpc)
[root@ibm-x3650m4-01-vm-03 ~]# grep rpc /etc/passwd
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
                           ^^^^^^^^^^^^^^^^^
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
[root@ibm-x3650m4-01-vm-03 ~]# ls /var/lib/rpcbind
ls: cannot access '/var/lib/rpcbind': No such file or directory
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
[root@ibm-x3650m4-01-vm-03 ~]# 
[root@ibm-x3650m4-01-vm-03 ~]# rpm -q --scripts rpcbind
preinstall scriptlet (using /bin/sh):

# Softly static allocate the rpc uid and gid.
getent group rpc >/dev/null || groupadd -f -g 32 -r rpc
if ! getent passwd rpc >/dev/null ; then
        if ! getent passwd 32 >/dev/null ; then
           useradd -l -c "Rpcbind Daemon" -d /var/lib/rpcbind  \
              -g rpc -M -s /sbin/nologin -o -u 32 rpc > /dev/null 2>&1
        else
           useradd -l -c "Rpcbind Daemon" -d /var/lib/rpcbind  \
              -g rpc -M -s /sbin/nologin rpc > /dev/null 2>&1
        fi
fi
postinstall scriptlet (using /bin/sh):

if [ $1 -eq 1 ] ; then 
        # Initial installation 
        systemctl --no-reload preset rpcbind.service rpcbind.socket &>/dev/null || : 
fi
preuninstall scriptlet (using /bin/sh):

if [ $1 -eq 0 ] ; then 
        # Package removal, not upgrade 
        systemctl --no-reload disable --now rpcbind.service rpcbind.socket &>/dev/null || : 
fi
postuninstall scriptlet (using /bin/sh):

if [ $1 -ge 1 ] ; then 
        # Package upgrade, not uninstall 
        systemctl try-restart rpcbind.service rpcbind.socket &>/dev/null || : 
fi
[root@ibm-x3650m4-01-vm-03 ~]# 


+++ This bug was initially created as a clone of Bug #1438502 +++

Description of problem:
On the latest version of RHEL 6 (v9), the rpcbind rpm creates an rpc user with directory path "/var/lib/rpcbind" but this directory path does not get created when the rpm is installed. 
The old directory path "/var/cache/rpcbind" gets created instead.

Looking at spec file for (rpcbind-0.2.0-13) the old path still listed:
mkdir -p %{buildroot}/var/cache/rpcbind

and the user now gets created with the wrong home path:
# Softly static allocate the rpc uid and gid.
getent group rpc >/dev/null || groupadd -f -g 32 -r rpc
if ! getent passwd rpc >/dev/null ; then
        if ! getent passwd 32 >/dev/null ; then
           useradd -l -c "Rpcbind Daemon" -d /var/lib/rpcbind  \
              -g rpc -M -s /sbin/nologin -o -u 32 rpc > /dev/null 2>&1
        else
           useradd -l -c "Rpcbind Daemon" -d /var/lib/rpcbind  \
              -g rpc -M -s /sbin/nologin rpc > /dev/null 2>&1
        fi
 fi

This is a change from what was listed on the spec file for (rpcbind-0.2.0-11 [RHEL6v7]) spec file:
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

Version-Release number of selected component (if applicable):
rpcbind-0.2.0-13.el6.x86_64

How reproducible:
Reproducible every time.

Comment 3 Yongcheng Yang 2021-07-06 03:20:51 UTC
This has been resolved now:

[root@rhel-9-latest ~]# rpm -q rpcbind
rpcbind-1.2.6-1.el9.x86_64
[root@rhel-9-latest ~]# grep rpc /etc/passwd
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
[root@rhel-9-latest ~]# ls -ld /var/lib/rpcbind/
drwxr-xr-x. 2 rpc rpc 6 Jul  2 04:07 /var/lib/rpcbind/
[root@rhel-9-latest ~]# ls -ld /var/lib/nfs
drwxr-xr-x. 5 root root 80 Jul  2 04:07 /var/lib/nfs
[root@rhel-9-latest ~]#


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