Fix adding of user and group (#699713)

This commit is contained in:
Jiri Popelka 2011-08-26 13:15:29 +02:00
parent b8f92d8f72
commit f68f02db2e

View File

@ -16,7 +16,7 @@
Summary: Dynamic host configuration protocol software Summary: Dynamic host configuration protocol software
Name: dhcp Name: dhcp
Version: 4.2.2 Version: 4.2.2
Release: 3%{?dist} Release: 4%{?dist}
# NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to
# dcantrell maintaining the package) made incorrect use of the epoch and # dcantrell maintaining the package) made incorrect use of the epoch and
# that's why it is at 12 now. It should have never been used, but it was. # that's why it is at 12 now. It should have never been used, but it was.
@ -77,6 +77,7 @@ BuildRequires: bind-lite-devel
Requires: %{name}-common = %{epoch}:%{version}-%{release} Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
Requires(pre): shadow-utils
Requires(post): chkconfig Requires(post): chkconfig
Requires(post): coreutils Requires(post): coreutils
Requires(post): systemd-units Requires(post): systemd-units
@ -467,6 +468,16 @@ EOF
# Don't package libtool *.la files # Don't package libtool *.la files
find ${RPM_BUILD_ROOT}/%{_libdir} -name '*.la' -exec '/bin/rm' '-f' '{}' ';'; find ${RPM_BUILD_ROOT}/%{_libdir} -name '*.la' -exec '/bin/rm' '-f' '{}' ';';
%pre
# /usr/share/doc/setup/uidgid
getent group dhcpd >/dev/null || groupadd --gid 177 --system dhcpd
getent passwd dhcpd >/dev/null || \
useradd --system \
--uid 177 --gid dhcpd \
--home /var/lib/dhcpd --shell /sbin/nologin \
--comment "DHCP server" dhcpd
exit 0
%post %post
sampleconf="# sampleconf="#
# DHCP Server Configuration file. # DHCP Server Configuration file.
@ -489,9 +500,6 @@ fi
# Initial installation # Initial installation
if [ $1 -eq 1 ] ; then if [ $1 -eq 1 ] ; then
# create system user/group dhcpd
useradd --system dhcpd
/bin/systemctl daemon-reload >/dev/null 2>&1 || : /bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi fi
@ -534,12 +542,6 @@ if [ $1 -ge 1 ]; then
/bin/systemctl try-restart dhcrelay.service >/dev/null 2>&1 || : /bin/systemctl try-restart dhcrelay.service >/dev/null 2>&1 || :
fi fi
# uninstall
if [ $1 -eq 0 ]; then
# delete user/group dhcpd
userdel dhcpd
fi
%post libs -p /sbin/ldconfig %post libs -p /sbin/ldconfig
@ -639,6 +641,9 @@ fi
%{_initddir}/dhcrelay %{_initddir}/dhcrelay
%changelog %changelog
* Fri Aug 26 2011 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.2-4
- Fix adding of user and group (#699713)
* Fri Aug 19 2011 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.2-3 * Fri Aug 19 2011 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.2-3
- Tighten explicit libs sub-package requirement so that it includes - Tighten explicit libs sub-package requirement so that it includes
the correct architecture as well. the correct architecture as well.