forked from rpms/rpcbind
Softly allocate rpc uid/gid (bz 1301288)
Signed-off-by: Steve Dickson <steved@redhat.com>
This commit is contained in:
parent
c0f80c5a67
commit
058b1d088d
27
rpcbind.spec
27
rpcbind.spec
@ -77,20 +77,16 @@ rm -rf %{buildroot}
|
|||||||
|
|
||||||
%pre
|
%pre
|
||||||
|
|
||||||
# Check the validity of the rpc uid and gid.
|
# Softly static allocate the rpc uid and gid.
|
||||||
# If they don't exist, create them
|
getent group rpc >/dev/null || groupadd -f -g 32 -r rpc
|
||||||
# If they exist but are the wrong value, remove them
|
if ! getent passwd rpc >/dev/null ; then
|
||||||
# and recreate them with the correct value
|
if ! getent passwd 32 >/dev/null ; then
|
||||||
# If they exist and are the correct value do nothing
|
useradd -l -c "Rpcbind Daemon" -d /var/lib/rpcbind \
|
||||||
rpcid=`getent passwd rpc | cut -d: -f 3`
|
-g rpc -M -s /sbin/nologin -o -u 32 rpc > /dev/null 2>&1
|
||||||
if [ -n "$rpcid" -a "$rpcid" != "32" ]; then
|
else
|
||||||
/usr/sbin/userdel rpc 2> /dev/null || :
|
useradd -l -c "Rpcbind Daemon" -d /var/lib/rpcbind \
|
||||||
/usr/sbin/groupdel rpc 2> /dev/null || :
|
-g rpc -M -s /sbin/nologin rpc > /dev/null 2>&1
|
||||||
fi
|
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/lib/rpcbind -g 32 \
|
|
||||||
-M -s /sbin/nologin -u 32 rpc > /dev/null 2>&1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%post
|
%post
|
||||||
@ -98,10 +94,6 @@ fi
|
|||||||
|
|
||||||
%preun
|
%preun
|
||||||
%systemd_preun rpcbind.service rpcbind.socket
|
%systemd_preun rpcbind.service rpcbind.socket
|
||||||
if [ $1 -eq 0 ]; then
|
|
||||||
/usr/sbin/userdel rpc 2>/dev/null || :
|
|
||||||
/usr/sbin/groupdel rpc 2>/dev/null || :
|
|
||||||
fi
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
%systemd_postun_with_restart rpcbind.service rpcbind.socket
|
%systemd_postun_with_restart rpcbind.service rpcbind.socket
|
||||||
@ -129,6 +121,7 @@ fi
|
|||||||
%changelog
|
%changelog
|
||||||
* Mon Apr 4 2016 Steve Dickson <steved@redhat.com> - 0.2.3-10.rc1
|
* Mon Apr 4 2016 Steve Dickson <steved@redhat.com> - 0.2.3-10.rc1
|
||||||
- Restart rpcbind.socket on restarts (bz 1306824)
|
- Restart rpcbind.socket on restarts (bz 1306824)
|
||||||
|
- Soft static allocate rpc uid/gid (bz 1301288)
|
||||||
|
|
||||||
* Sat Feb 20 2016 Steve Dickson <steved@redhat.com> - 0.2.3-9.rc1
|
* Sat Feb 20 2016 Steve Dickson <steved@redhat.com> - 0.2.3-9.rc1
|
||||||
- Updated to the latest RC release rpcbind-0_2_4-rc1
|
- Updated to the latest RC release rpcbind-0_2_4-rc1
|
||||||
|
Loading…
Reference in New Issue
Block a user