From 545f5ca254be5d4309e55070933a280108967ab3 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 16 Feb 2020 13:11:46 +0100 Subject: ddclient: change file permission on generated config ddclient complains when the file permission is not user = rw. --- src/conf_mode/dynamic_dns.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/conf_mode/dynamic_dns.py b/src/conf_mode/dynamic_dns.py index d55e732df..9f2d3b836 100755 --- a/src/conf_mode/dynamic_dns.py +++ b/src/conf_mode/dynamic_dns.py @@ -18,6 +18,7 @@ import os import sys import jinja2 +from stat import S_IRUSR, S_IWUSR from vyos.config import Config from vyos import ConfigError @@ -271,6 +272,9 @@ def generate(dyndns): with open(config_file, 'w') as f: f.write(config_text) + # Config file must be accessible only by its owner + os.chmod(config_file, S_IRUSR | S_IWUSR) + return None def apply(dyndns): -- cgit v1.2.3