diff options
author | Christian Breunig <christian@breunig.cc> | 2023-05-05 22:52:06 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2023-05-05 22:52:06 +0200 |
commit | 2c8647350a771a8e28db03ec82cda20b58db7323 (patch) | |
tree | edfec8adb73192f876be333660e73de1dd4cdadc /interface-definitions | |
parent | 11e25707683138d4a5a64a3717160edb84816182 (diff) | |
download | vyos-1x-2c8647350a771a8e28db03ec82cda20b58db7323.tar.gz vyos-1x-2c8647350a771a8e28db03ec82cda20b58db7323.zip |
syslog: T2769: xml: provide common constraint for system usernames
Diffstat (limited to 'interface-definitions')
-rw-r--r-- | interface-definitions/include/constraint/login-username.xml.i | 3 | ||||
-rw-r--r-- | interface-definitions/system-login.xml.in | 2 | ||||
-rw-r--r-- | interface-definitions/system-syslog.xml.in | 10 |
3 files changed, 9 insertions, 6 deletions
diff --git a/interface-definitions/include/constraint/login-username.xml.i b/interface-definitions/include/constraint/login-username.xml.i new file mode 100644 index 000000000..09a68b796 --- /dev/null +++ b/interface-definitions/include/constraint/login-username.xml.i @@ -0,0 +1,3 @@ +<!-- include start from constraint/login-username.xml.i --> +<regex>[-_a-zA-Z0-9.]{1,100}</regex> +<!-- include end --> diff --git a/interface-definitions/system-login.xml.in b/interface-definitions/system-login.xml.in index 258913929..be4f53c3b 100644 --- a/interface-definitions/system-login.xml.in +++ b/interface-definitions/system-login.xml.in @@ -12,7 +12,7 @@ <properties> <help>Local user account information</help> <constraint> - <regex>[-_a-zA-Z0-9.]{1,100}</regex> + #include <include/constraint/login-username.xml.i> </constraint> <constraintErrorMessage>Username contains illegal characters or\nexceeds 100 character limitation.</constraintErrorMessage> </properties> diff --git a/interface-definitions/system-syslog.xml.in b/interface-definitions/system-syslog.xml.in index 90c3de5c1..fbba9ae9e 100644 --- a/interface-definitions/system-syslog.xml.in +++ b/interface-definitions/system-syslog.xml.in @@ -11,14 +11,14 @@ <tagNode name="user"> <properties> <help>Logging to specific terminal of given user</help> - <constraint> - <regex>[a-z_][a-z0-9_-]{1,31}[$]?</regex> - </constraint> - <constraintErrorMessage>illegal characters in user</constraintErrorMessage> <valueHelp> - <format>username</format> + <format>txt</format> <description>user login name</description> </valueHelp> + <constraint> + #include <include/constraint/login-username.xml.i> + </constraint> + <constraintErrorMessage>illegal characters in user</constraintErrorMessage> </properties> <children> <tagNode name="facility"> |