summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-pppoe.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-02-25 12:37:54 +0100
committerChristian Poessinger <christian@poessinger.com>2020-02-25 12:38:00 +0100
commit7291397ad9b0919982806b848cccca550fa9dfc3 (patch)
tree5d9666b3daeccbb353e36d514e3220ea9a561e2f /src/conf_mode/interfaces-pppoe.py
parent9d68d23a2455cd11f77af6d94a021812771f2356 (diff)
downloadvyos-1x-7291397ad9b0919982806b848cccca550fa9dfc3.tar.gz
vyos-1x-7291397ad9b0919982806b848cccca550fa9dfc3.zip
pppoe: T2055: verify logfile really exists
Diffstat (limited to 'src/conf_mode/interfaces-pppoe.py')
-rwxr-xr-xsrc/conf_mode/interfaces-pppoe.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/conf_mode/interfaces-pppoe.py b/src/conf_mode/interfaces-pppoe.py
index 02d3cf3ce..6acb45d5e 100755
--- a/src/conf_mode/interfaces-pppoe.py
+++ b/src/conf_mode/interfaces-pppoe.py
@@ -250,15 +250,16 @@ def apply(pppoe):
return None
if not pppoe['disable']:
- # make logfile owned by root / vyattacfg
- uid = getpwnam('root').pw_uid
- gid = getgrnam('vyattacfg').gr_gid
- os.chown(pppoe['logfile'], uid, gid)
-
# dial PPPoE connection
cmd = 'systemctl start ppp@{}.service'.format(pppoe['intf'])
subprocess_cmd(cmd)
+ # make logfile owned by root / vyattacfg
+ if os.path.isfile(pppoe['logfile']):
+ uid = getpwnam('root').pw_uid
+ gid = getgrnam('vyattacfg').gr_gid
+ os.chown(pppoe['logfile'], uid, gid)
+
# better late then sorry ... but we can only set interface alias after
# pppd has been launched and created the interface
cnt = 0