From d16348285127f638ae94aa91fdc94d6509d45af1 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 8 Apr 2020 22:30:21 +0200 Subject: vyos.util: introduce chmod_750() for files/directories --- src/conf_mode/interfaces-wireguard.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/conf_mode/interfaces-wireguard.py') diff --git a/src/conf_mode/interfaces-wireguard.py b/src/conf_mode/interfaces-wireguard.py index e9d9ad459..8e80a85a2 100755 --- a/src/conf_mode/interfaces-wireguard.py +++ b/src/conf_mode/interfaces-wireguard.py @@ -24,7 +24,7 @@ from netifaces import interfaces from vyos.config import Config from vyos.configdict import list_diff from vyos.ifconfig import WireGuardIf -from vyos.util import chown, run, is_bridge_member +from vyos.util import chown, run, is_bridge_member, chmod_750 from vyos import ConfigError kdir = r'/config/auth/wireguard' @@ -60,8 +60,7 @@ def _migrate_default_keys(): os.makedirs(location) chown(location, 'root', 'vyattacfg') - run(f'sudo chmod 750 {location}') - + chmod_750(location) os.rename(f'{kdir}/private.key', f'{location}/private.key') os.rename(f'{kdir}/public.key', f'{location}/public.key') -- cgit v1.2.3