SHA256
1
0
forked from pool/nsd

- Own the config zones directory

OBS-URL: https://build.opensuse.org/package/show/server:dns/nsd?expand=0&rev=37
This commit is contained in:
Adam Majer 2018-02-12 10:43:27 +00:00 committed by Git OBS Bridge
parent 15a8757c21
commit 7e18382f9f
2 changed files with 7 additions and 2 deletions

View File

@ -4,6 +4,7 @@ Mon Feb 12 08:54:46 UTC 2018 - adam.majer@suse.de
- Create a system user, not a regular user
- Check if user/group already exists and are in system range
- Do not ignore return values from user/group creation
- Own the config zones directory
-------------------------------------------------------------------
Mon Feb 5 10:26:02 UTC 2018 - adam.majer@suse.de

View File

@ -103,6 +103,7 @@ install -d -m 0700 %{buildroot}%{home} \
#
install -d -m 0755 %{buildroot}/%{_localstatedir}/log/nsd/
touch %{buildroot}%{home}/{nsd.db,ixfr.db,xfrd.state} %{buildroot}/%{_localstatedir}/log/nsd/nsd.log
mkdir -m 0750 %{buildroot}%{zonesdir}
%if %{with systemd}
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/nsd.service
@ -117,10 +118,12 @@ ln -s -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
#
# adding user and group, if it doesn't exist yet
#
if ! ${_bindir}/id _nsd > /dev/null 2> /dev/null; then
if ! %{_bindir}/id _nsd > /dev/null 2> /dev/null
then
echo "Creating _nsd:_nsd" && \
%{_sbindir}/groupadd -r _nsd && \
%{_sbindir}/useradd -r -g _nsd -s /bin/false -r -c "user for %{name}" -d %{home} _nsd
%{_sbindir}/useradd -r -g _nsd -s /bin/false -r -c "user for %{name}" -d %{home} _nsd || \
exit $?
fi
%if %{with systemd}
%service_add_pre %{name}.service
@ -196,6 +199,7 @@ fi
#
%config(noreplace) %attr(-,root,_nsd) %{configdir}
%ghost %config %attr(640,_nsd,_nsd) %{configdir}/nsd.conf
%dir %attr(750,root,_nsd) %{zonesdir}
#
%dir %attr(750,_nsd,_nsd) %{home}
%ghost %config %attr(640,_nsd,_nsd) %{home}/nsd.db