Provide a sysusers.d file to get user() and group() provides (#2134071)

This commit is contained in:
Luboš Uhliarik 2022-10-12 13:46:39 +02:00
parent b6675637de
commit 1e6d0f7e8c
2 changed files with 15 additions and 13 deletions

View File

@ -2,7 +2,7 @@
Name: squid Name: squid
Version: 5.7 Version: 5.7
Release: 1%{?dist} Release: 2%{?dist}
Summary: The Squid proxy caching server Summary: The Squid proxy caching server
Epoch: 7 Epoch: 7
# See CREDITS for breakdown of non GPLv2+ code # See CREDITS for breakdown of non GPLv2+ code
@ -18,6 +18,7 @@ Source5: squid.pam
Source6: squid.nm Source6: squid.nm
Source7: squid.service Source7: squid.service
Source8: cache_swap.sh Source8: cache_swap.sh
Source9: squid.sysusers
Source98: perl-requires-squid.sh Source98: perl-requires-squid.sh
@ -41,9 +42,10 @@ Requires: bash gawk
# for httpd conf file - cachemgr script alias # for httpd conf file - cachemgr script alias
Requires: httpd-filesystem Requires: httpd-filesystem
Requires(pre): shadow-utils Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd %systemd_requires
Requires(postun): systemd %{?sysusers_requires_compat}
# squid_ldap_auth and other LDAP helpers require OpenLDAP # squid_ldap_auth and other LDAP helpers require OpenLDAP
BuildRequires: make BuildRequires: make
BuildRequires: openldap-devel BuildRequires: openldap-devel
@ -224,6 +226,8 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/squid/squid.conf.documented
# remove unpackaged files from the buildroot # remove unpackaged files from the buildroot
rm -f $RPM_BUILD_ROOT/squid.httpd.tmp rm -f $RPM_BUILD_ROOT/squid.httpd.tmp
# sysusers.d
install -p -D -m 0644 %{SOURCE9} %{buildroot}%{_sysusersdir}/squid.conf
%files %files
%license COPYING %license COPYING
@ -265,15 +269,10 @@ rm -f $RPM_BUILD_ROOT/squid.httpd.tmp
%{_libdir}/squid/* %{_libdir}/squid/*
%{_datadir}/snmp/mibs/SQUID-MIB.txt %{_datadir}/snmp/mibs/SQUID-MIB.txt
%{_tmpfilesdir}/squid.conf %{_tmpfilesdir}/squid.conf
%{_sysusersdir}/squid.conf
%pre %pre
if ! getent group squid >/dev/null 2>&1; then %sysusers_create_compat %{SOURCE9}
/usr/sbin/groupadd -g 23 squid
fi
if ! getent passwd squid >/dev/null 2>&1 ; then
/usr/sbin/useradd -g 23 -u 23 -d /var/spool/squid -r -s /sbin/nologin squid >/dev/null 2>&1 || exit 1
fi
for i in /var/log/squid /var/spool/squid ; do for i in /var/log/squid /var/spool/squid ; do
if [ -d $i ] ; then if [ -d $i ] ; then
@ -316,8 +315,6 @@ do
end end
end end
%post %post
%systemd_post squid.service %systemd_post squid.service
@ -336,6 +333,9 @@ fi
%changelog %changelog
* Wed Oct 12 2022 Luboš Uhliarik <luhliari@redhat.com> - 7:5.7-2
- Provide a sysusers.d file to get user() and group() provides (#2134071)
* Tue Sep 06 2022 Luboš Uhliarik <luhliari@redhat.com> - 7:5.7-1 * Tue Sep 06 2022 Luboš Uhliarik <luhliari@redhat.com> - 7:5.7-1
- new version 5.7 - new version 5.7

2
squid.sysusers Normal file
View File

@ -0,0 +1,2 @@
g squid 23 -
u squid 23 "Squid proxy user" /var/spool/squid /sbin/nologin