From db5bc9cf7e0aece8bd693a57a5e7edf432f2c93f Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 22 Jun 2020 11:14:16 +0500 Subject: [PATCH] update pdns permissions for cent8 --- install/install.py | 7 +++++++ plogical/upgrade.py | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/install/install.py b/install/install.py index 6dff30fd7..c56ebd426 100755 --- a/install/install.py +++ b/install/install.py @@ -596,6 +596,13 @@ class preFlightsChecks: command = "find /usr/local/CyberCP/ -name '*.pyc' -delete" preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + if self.distro == cent8: + command = 'chown root:pdns /etc/pdns/pdns.conf' + preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + + command = 'chmod 640 /etc/pdns/pdns.conf' + preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + def install_unzip(self): self.stdOut("Install unzip") try: diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 0cb4cb16c..0d3417cd2 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1659,6 +1659,14 @@ class Upgrade: command = "find /usr/local/CyberCP/ -name '*.pyc' -delete" Upgrade.executioner(command, 0) + if os.path.exists(Upgrade.CentOSPath): + if Upgrade.decideCentosVersion() == CENTOS8: + command = 'chown root:pdns /etc/pdns/pdns.conf' + Upgrade.executioner(command, 0) + + command = 'chmod 640 /etc/pdns/pdns.conf' + Upgrade.executioner(command, 0) + Upgrade.stdOut("Permissions updated.") except BaseException as msg: