diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-09-03 11:11:32 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-09-03 11:11:32 -0700 |
commit | a0fe319ce069e15646077a635bc970b961124540 (patch) | |
tree | ca6f3cefc90f01ef983c5d4e9829e3c6480a35f3 /templates/system | |
parent | de6ccee222ea7eee70c82d00aa11525f4a481a58 (diff) | |
download | vyatta-cfg-system-a0fe319ce069e15646077a635bc970b961124540.tar.gz vyatta-cfg-system-a0fe319ce069e15646077a635bc970b961124540.zip |
Validate encrypted password field
Enforce syntax checks on encrypted password field to prevent user
errors.
Bug: 4077
Diffstat (limited to 'templates/system')
-rw-r--r-- | templates/system/login/user/node.tag/authentication/encrypted-password/node.def | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/templates/system/login/user/node.tag/authentication/encrypted-password/node.def b/templates/system/login/user/node.tag/authentication/encrypted-password/node.def index 3c12bdc3..5234702b 100644 --- a/templates/system/login/user/node.tag/authentication/encrypted-password/node.def +++ b/templates/system/login/user/node.tag/authentication/encrypted-password/node.def @@ -1,2 +1,11 @@ type: txt help: Set encrypted password +# Allow * or ! to disable account +# DES format password (13 characters) +# MD5 format ($1) and SHA format passwords +syntax:expression: ($VAR(@) == "*" || $VAR(*) == "!" \ + || ( pattern $VAR(@) "^[a-zA-Z0-9\.\/]{13}$" ) \ + || ( pattern $VAR(@) "^\\$1\\$[a-zA-Z0-9\.\/]{8}\\$[a-zA-Z0-9\.\/]{22}$" ) \ + || ( pattern $VAR(@) "^\\$5\\$[a-zA-Z0-9\.\/]{16}\\$[a-zA-Z0-9\.\/]{43}$" ) \ + || ( pattern $VAR(@) "^\\$6\\$[a-zA-Z0-9\.\/]{16}\\$[a-zA-Z0-9\.\/]{86}$" )) \ + ; "Not a valid encrypted password for user $VAR(../../@)" |