Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
DescriptionFreddy E. Montero
2017-04-03 14:53:42 UTC
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.
Steps to Reproduce:
1. Install rpcbind-0.2.0-13
2.
3.
(In reply to Freddy E. Montero from comment #0)
> 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
> > Version-Release number of selected component (if applicable):
> rpcbind-0.2.0-13.el6.x86_64
>
> How reproducible:
> Reproducible every time.
>
Easy to reproduce with rpcbind-0.2.0-13. Same test on RHEL-7 shows this problem may not exist on them:
- RHEL-6.9 + rpcbind-0.2.0-13
[root@~ ~]# rpm -qa |grep rpcbind
rpcbind-0.2.0-13.el6.x86_64
[root@~ ~]# cat /etc/passwd|grep rpc
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
[root@~ ~]# test -d /var/lib/rpcbind;echo $?
1
- RHEL-7.4 nightly + rpcbind-0.2.0-39.el7.x86_64
[root@~ ~]# rpm -qa |grep rpcbind
rpcbind-0.2.0-39.el7.x86_64
[root@~ ~]# cat /etc/passwd|grep rpc
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
[root@~ ~]# test -d /var/lib/rpcbind;echo $?
0
I guess I don't understand what the problem is...
rpcbind used a new cache directory but the same home directory for the
rpc account. Why is that a problem?
The issue in the rpcbind rpm is that the rpm does not contain a /var/lib/rpcbind nor does the specfile create one -
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog README
/sbin/rpcbind
%{_sbindir}/rpcinfo
%{_mandir}/man8/*
%config %{_initddir}/rpcbind
%dir %attr(700,rpc,rpc) /var/cache/rpcbind
however the rpcbind user is created with a home directory of /var/lib/rpcbind ..
# 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
regardless if rpcbind chooses to cache in /var/cache/rpcbind or /var/lib/rpcbind - or if both are created - the /var/lib/rpcbind directory should either be created or the useradd should be adjusted to point to the cache dir
simply fix the specfile and/or the rpm
(In reply to Jonathan Edwards from comment #7)
>
> # 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
>
>
> regardless if rpcbind chooses to cache in /var/cache/rpcbind or
> /var/lib/rpcbind - or if both are created - the /var/lib/rpcbind directory
> should either be created or the useradd should be adjusted to point to the
> cache dir
>
> simply fix the specfile and/or the rpm
What I don't understand is why /var/lib/rpcbind is not being created.
Looking at useradd(8) the '-d' should be creating the directory
"The new user will be created using HOME_DIR as the value for the user."
and it usually does..
I guess the logic behind using both /var/cache and /var/lib is
caches are not stable (aka they can be removed) which is
not the case with home directories... They need to be stable.
Comment 10Steve Whitehouse
2017-12-01 10:46:50 UTC
SteveD, what is the status on this one? We need to decide what we need to do here.
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. Steps to Reproduce: 1. Install rpcbind-0.2.0-13 2. 3.