use sysusers file to provide radiusd user and group [release 3.2.4-2mamba;Sat Jun 08 2024]

This commit is contained in:
Silvan Calarco 2024-06-09 21:52:43 +02:00
parent 812a50560c
commit 6987b16863
2 changed files with 20 additions and 24 deletions

View File

@ -1,11 +1,7 @@
%define radiusd_uid 65024
%define radiusd_gid 65024
%define libname libfreeradius %define libname libfreeradius
Name: freeradius-server Name: freeradius-server
Version: 3.2.3 Version: 3.2.4
Release: 1mamba Release: 2mamba
Summary: A high performance and highly configurable GPL'd free RADIUS server Summary: A high performance and highly configurable GPL'd free RADIUS server
Group: System/Servers Group: System/Servers
Vendor: openmamba Vendor: openmamba
@ -39,6 +35,8 @@ BuildRequires: libiodbc-devel
BuildRequires: libjson-c-devel BuildRequires: libjson-c-devel
BuildRequires: libkrb5-devel BuildRequires: libkrb5-devel
BuildRequires: libmariadb-devel BuildRequires: libmariadb-devel
BuildRequires: libmemcached-devel
BuildRequires: libmongo-c-driver-devel
BuildRequires: libnsl-devel BuildRequires: libnsl-devel
BuildRequires: libodbc-devel BuildRequires: libodbc-devel
BuildRequires: libopenldap-devel BuildRequires: libopenldap-devel
@ -55,7 +53,9 @@ BuildRequires: libtalloc-devel
BuildRequires: libtermcap-devel BuildRequires: libtermcap-devel
BuildRequires: libunbound-devel BuildRequires: libunbound-devel
BuildRequires: libwbclient-devel BuildRequires: libwbclient-devel
BuildRequires: libxcrypt-devel
BuildRequires: libz-devel BuildRequires: libz-devel
BuildRequires: perl-Convert-Base32
BuildRequires: perl-DBI BuildRequires: perl-DBI
BuildRequires: perl-Net-IP BuildRequires: perl-Net-IP
BuildRequires: perl-devel BuildRequires: perl-devel
@ -65,7 +65,7 @@ BuildRequires: libopenldap-devel >= 2.2.20
BuildRequires: libruby-devel >= 3.2.0 BuildRequires: libruby-devel >= 3.2.0
Provides: freeradius Provides: freeradius
Obsoletes: freeradius < 3.2.1 Obsoletes: freeradius < 3.2.1
Requires: %{libname} = %{version} Requires: %{libname} = %{version}-%{release}
Requires: openldap-servers >= 2.1.22 Requires: openldap-servers >= 2.1.22
%description %description
@ -190,8 +190,8 @@ install -D -m0644 %{SOURCE4} \
%{buildroot}%{_unitdir}/freeradius.service %{buildroot}%{_unitdir}/freeradius.service
install -D -m0644 %{SOURCE5} \ install -D -m0644 %{SOURCE5} \
%{buildroot}%{_tmpfilesdir}/freeradius.conf %{buildroot}%{_tmpfilesdir}/freeradius.conf
#install -D -m0644 %{SOURCE6} \ install -D -m0644 %{SOURCE6} \
# %{buildroot}%{_sysusersdir}/freeradius.conf %{buildroot}%{_sysusersdir}/freeradius.conf
install -D -m0644 redhat/freeradius-logrotate \ install -D -m0644 redhat/freeradius-logrotate \
%{buildroot}%{_sysconfdir}/logrotate.d/freeradius %{buildroot}%{_sysconfdir}/logrotate.d/freeradius
@ -224,20 +224,11 @@ rm -f %{buildroot}%{_sysconfdir}/raddb/oraclesql.conf
[ "%{buildroot}" != / ] && rm -rf %{buildroot} [ "%{buildroot}" != / ] && rm -rf %{buildroot}
%pre %pre
if [ $1 -eq 1 ]; then %sysusers_create_compat %{SOURCE6}
# new install
/usr/sbin/groupadd -g %{radiusd_gid} radiusd
/usr/sbin/useradd -u %{radiusd_uid} -c radiusd -d /dev/null -g radiusd -s /bin/false radiusd
fi
%systemd_pre freeradius
: :
%preun %preun
%systemd_preun freeradius %systemd_preun freeradius
if [ $1 -eq 0 ]; then
/usr/sbin/userdel radiusd
/usr/sbin/groupdel radiusd
fi
: :
%postun %postun
@ -292,6 +283,7 @@ fi
%{_sbindir}/* %{_sbindir}/*
%{_unitdir}/freeradius.service %{_unitdir}/freeradius.service
%{_tmpfilesdir}/freeradius.conf %{_tmpfilesdir}/freeradius.conf
%{_sysusersdir}/freeradius.conf
%dir %{_datadir}/freeradius %dir %{_datadir}/freeradius
%{_datadir}/freeradius/* %{_datadir}/freeradius/*
%attr(0644,root,root) %{_datadir}/snmp/mibs/* %attr(0644,root,root) %{_datadir}/snmp/mibs/*
@ -309,10 +301,6 @@ fi
%files -n %{libname} %files -n %{libname}
%defattr(-,root,root) %defattr(-,root,root)
#%{_libdir}/%{name}/libradius*.la
#%{_libdir}/%{name}/libradius*.so
#%{_libdir}/%{name}/libeap*.la
#%{_libdir}/%{name}/libeap*.so
%{_libdir}/%{name}/proto_dhcp.la %{_libdir}/%{name}/proto_dhcp.la
%{_libdir}/%{name}/proto_dhcp.so %{_libdir}/%{name}/proto_dhcp.so
%{_libdir}/%{name}/proto_vmps.la %{_libdir}/%{name}/proto_vmps.la
@ -366,6 +354,12 @@ fi
%{_libdir}/%{name}/rlm_sql_unixodbc*.la %{_libdir}/%{name}/rlm_sql_unixodbc*.la
%changelog %changelog
* Sat Jun 08 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 3.2.4-2mamba
- use sysusers file to provide radiusd user and group
* Fri May 31 2024 Automatic Build System <autodist@openmamba.org> 3.2.4-1mamba
- automatic version update by autodist
* Sat May 27 2023 Automatic Build System <autodist@mambasoft.it> 3.2.3-1mamba * Sat May 27 2023 Automatic Build System <autodist@mambasoft.it> 3.2.3-1mamba
- automatic version update by autodist - automatic version update by autodist

View File

@ -1 +1,3 @@
u radiusd - "radius daemon" - #Type Name ID GECOS Home directory Shell
u radiusd - "radiusd user" /var/lib/radiusd /sbin/nologin
g radiusd - - - -