diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2011-02-25 09:07:41 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2011-02-25 09:07:41 -0800 |
commit | 6c9f83f6bcf081973f25c7564cc61ba07ae2cfd2 (patch) | |
tree | 5d7f2c464c0bb85e3ca6b9e290a449d5948568ba /templates/system/host-name | |
parent | b541f5ffa7bf1c6951e01ae4814e0cd38adc42d5 (diff) | |
download | vyatta-cfg-quagga-6c9f83f6bcf081973f25c7564cc61ba07ae2cfd2.tar.gz vyatta-cfg-quagga-6c9f83f6bcf081973f25c7564cc61ba07ae2cfd2.zip |
Validate domain and host name
Bug 6243
More complete validation of host name and domain name
Diffstat (limited to 'templates/system/host-name')
-rw-r--r-- | templates/system/host-name/node.def | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/templates/system/host-name/node.def b/templates/system/host-name/node.def index df266fad..8c733b9f 100644 --- a/templates/system/host-name/node.def +++ b/templates/system/host-name/node.def @@ -4,6 +4,9 @@ help: System host name (default: vyatta) default: "vyatta" syntax:expression: pattern $VAR(@) "^[[:alnum:]][-.[:alnum:]]*[[:alnum:]]$" ; "invalid host name $VAR(@)" + +syntax:expression: pattern $VAR(@) "^.{1,63}$" ; "invalid host-name length" + update: sudo sh -c " \ hostname '$VAR(@)' echo '$VAR(@)' > /etc/hostname |