This also changes the default mode from 660 to 640.
Fixes #8333, at least mostly.
echo -n "Creating user and group pdns..."
adduser --quiet --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns
echo "done"
- chown pdns:root /etc/powerdns/pdns.conf
+ fi
+ if [ "`stat -c '%U:%G' /etc/powerdns/pdns.conf`" = "root:root" ]; then
+ chown root:pdns /etc/powerdns/pdns.conf
+ # Make sure that pdns can read it; the default used to be 0600
+ chmod g+r /etc/powerdns/pdns.conf
fi
chown pdns:pdns /var/lib/powerdns || :
;;
override_dh_fixperms:
dh_fixperms
- # these files often contain passwords. 660 as it is chowned to root:pdns
- chmod 0660 debian/pdns-server/etc/powerdns/pdns.conf
+ # these files often contain passwords. 640 as it is chowned to root:pdns
+ chmod 0640 debian/pdns-server/etc/powerdns/pdns.conf
# restore moved files
override_dh_clean:
echo -n "Creating user and group pdns..."
adduser --quiet --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns
echo "done"
- chown pdns:root /etc/powerdns/pdns.conf
+ fi
+ if [ "`stat -c '%U:%G' /etc/powerdns/pdns.conf`" = "root:root" ]; then
+ chown root:pdns /etc/powerdns/pdns.conf
+ # Make sure that pdns can read it; the default used to be 0600
+ chmod g+r /etc/powerdns/pdns.conf
fi
chown pdns:pdns /var/lib/powerdns || :
;;
override_dh_fixperms:
dh_fixperms
- # these files often contain passwords. 660 as it is chowned to root:pdns
- chmod 0660 debian/pdns-server/etc/powerdns/pdns.conf
+ # these files often contain passwords. 640 as it is chowned to root:pdns
+ chmod 0640 debian/pdns-server/etc/powerdns/pdns.conf
# restore moved files
override_dh_clean:
echo -n "Creating user and group pdns..."
adduser --quiet --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns
echo "done"
- chown pdns:root /etc/powerdns/pdns.conf
+ fi
+ if [ "`stat -c '%U:%G' /etc/powerdns/pdns.conf`" = "root:root" ]; then
+ chown root:pdns /etc/powerdns/pdns.conf
+ # Make sure that pdns can read it; the default used to be 0600
+ chmod g+r /etc/powerdns/pdns.conf
fi
chown pdns:pdns /var/lib/powerdns || :
;;
override_dh_fixperms:
dh_fixperms
- # these files often contain passwords. 660 as it is chowned to root:pdns
- chmod 0660 debian/pdns-server/etc/powerdns/pdns.conf
+ # these files often contain passwords. 640 as it is chowned to root:pdns
+ chmod 0640 debian/pdns-server/etc/powerdns/pdns.conf
# restore moved files
override_dh_clean: