summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhagbard <vyosdev@derith.de>2018-11-22 10:35:42 -0800
committerhagbard <vyosdev@derith.de>2018-11-22 10:37:54 -0800
commit5ba27a6ac6e391af2c111b867c892fd0e9ec1a72 (patch)
treeebcad57afd364d68d29847682cbbfdfcece232f9
parent1ad7b262b4bc487ad6b69c58661cdda730196202 (diff)
downloadvyos-1x-5ba27a6ac6e391af2c111b867c892fd0e9ec1a72.tar.gz
vyos-1x-5ba27a6ac6e391af2c111b867c892fd0e9ec1a72.zip
T835: accel-ppp: pppoe implementation
- verify if an auth mode is set and if its local checking that a user and password for chap-secrets exists.
-rwxr-xr-xsrc/conf_mode/accel_pppoe.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/conf_mode/accel_pppoe.py b/src/conf_mode/accel_pppoe.py
index 7f721f932..f0a7fcf96 100755
--- a/src/conf_mode/accel_pppoe.py
+++ b/src/conf_mode/accel_pppoe.py
@@ -368,7 +368,9 @@ def get_config():
config_data['snmp'] = 'enable-ma'
#### authentication mode local
-
+ if not c.exists('authentication mode'):
+ raise ConfigError('pppoe-server authentication mode required')
+
if c.exists('authentication mode local'):
if c.exists('authentication local-users username'):
for usr in c.list_nodes('authentication local-users username'):
@@ -478,13 +480,16 @@ def get_config():
def verify(c):
if c == None:
return None
-
- for usr in c['authentication']['local-users']:
- if not c['authentication']['local-users'][usr]:
- raise ConfigError('user ' + usr + ' has no password set')
+ if c['authentication']['mode'] == 'local':
+ if not c['authentication']['local-users']:
+ raise ConfigError('pppoe-server authentication local-users required')
+
+ for usr in c['authentication']['local-users']:
+ if not c['authentication']['local-users'][usr]['passwd']:
+ raise ConfigError('user ' + usr + ' requires a password')
if not c['ppp_gw']:
- raise ConfigError('pppoe gateway-ip required')
+ raise ConfigError('pppoe-server local-ip required')
if c['authentication']['mode'] == 'radius':
if len(c['authentication']['radiussrv']) == 0: