IS_BINDCHROOT: fix /etc/default path for Debian >= 11 (renamed from bind9 to named)

This commit is contained in:
William Hirigoyen 2023-07-17 12:15:45 +02:00
parent 6414a8c70e
commit 152653d773
2 changed files with 6 additions and 1 deletions

View file

@ -12,6 +12,7 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
### Removed
### Fixed
* IS_BINDCHROOT: fix /etc/default path for Debian >= 11 (renamed from bind9 to named)
### Security

View file

@ -440,7 +440,11 @@ check_log2mailsquid() {
check_bindchroot() {
if is_installed bind9; then
if netstat -utpln | grep "/named" | grep :53 | grep -qvE "(127.0.0.1|::1)"; then
if grep -q '^OPTIONS=".*-t' /etc/default/bind9 && grep -q '^OPTIONS=".*-u' /etc/default/bind9; then
default_conf=/etc/default/named
if is_debian_buster || is_debian_stretch; then
default_conf=/etc/default/bind9
fi
if grep -q '^OPTIONS=".*-t' "${default_conf}" && grep -q '^OPTIONS=".*-u' "${default_conf}"; then
md5_original=$(md5sum /usr/sbin/named | cut -f 1 -d ' ')
md5_chrooted=$(md5sum /var/chroot-bind/usr/sbin/named | cut -f 1 -d ' ')
if [ "$md5_original" != "$md5_chrooted" ]; then