Skip to content

Commit

Permalink
chown/mods for systemd case for more smooth upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
omoerbeek committed Sep 30, 2019
1 parent d2138f2 commit c98c0ef
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions builder-support/debian/dnsdist/debian-buster/dnsdist.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ case "$1" in

adduser --force-badname --system --home /nonexistent --group \
--no-create-home --quiet _dnsdist || true

if [ "`stat -c '%U:%G' /etc/powerdns/dnsdist.conf`" = "root:root" ]; then
chown root:_dnsdist /etc/powerdns/dnsdist.conf
# Make sure that dnsdist can read it; the default used to be 0600
chmod g+r /etc/powerdns/dnsdist.conf
fi
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down
4 changes: 4 additions & 0 deletions builder-support/debian/dnsdist/debian-buster/rules
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,7 @@ override_dh_installexamples:
override_dh_installinit:
# do nothing here. avoids referencing a non-existant init script.

override_dh_fixperms:
dh_fixperms
# these files often contain passwords. 640 as it is chowned to root:_dnsdist
chmod 0640 debian/pdns-server/etc/powerdns/dnsdist.conf
6 changes: 6 additions & 0 deletions builder-support/debian/dnsdist/debian-jessie/dnsdist.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ case "$1" in

adduser --force-badname --system --home /nonexistent --group \
--no-create-home --quiet _dnsdist || true

if [ "`stat -c '%U:%G' /etc/powerdns/dnsdist.conf`" = "root:root" ]; then
chown root:_dnsdist /etc/powerdns/dnsdist.conf
# Make sure that dnsdist can read it; the default used to be 0600
chmod g+r /etc/powerdns/dnsdist.conf
fi
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down
5 changes: 5 additions & 0 deletions builder-support/debian/dnsdist/debian-jessie/rules
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,8 @@ override_dh_strip:
override_dh_installinit:
dh_installinit
dh_systemd_start -pdnsdist --restart-after-upgrade dnsdist.service

override_dh_fixperms:
dh_fixperms
# these files often contain passwords. 640 as it is chowned to root:_dnsdist
chmod 0640 debian/pdns-server/etc/powerdns/dnsdist.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ case "$1" in

adduser --force-badname --system --home /nonexistent --group \
--no-create-home --quiet _dnsdist || true

if [ "`stat -c '%U:%G' /etc/powerdns/dnsdist.conf`" = "root:root" ]; then
chown root:_dnsdist /etc/powerdns/dnsdist.conf
# Make sure that dnsdist can read it; the default used to be 0600
chmod g+r /etc/powerdns/dnsdist.conf
fi
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down
4 changes: 4 additions & 0 deletions builder-support/debian/dnsdist/debian-stretch/rules
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ override_dh_installexamples:
override_dh_installinit:
# do nothing here. avoids referencing a non-existant init script.

override_dh_fixperms:
dh_fixperms
# these files often contain passwords. 640 as it is chowned to root:_dnsdist
chmod 0640 debian/pdns-server/etc/powerdns/dnsdist.conf

0 comments on commit c98c0ef

Please sign in to comment.