From 67437a202498f8ae9fd3a2a9828142390ddd46e1 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 3 Mar 2008 13:18:16 -0800 Subject: don't allow illegal hostnames Be more restrictive on hostnames to conform with RFC 952. Host name can't begin or end with a minus sign. --- templates/system/host-name/node.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/system/host-name/node.def b/templates/system/host-name/node.def index 54ed9fef..437a939d 100644 --- a/templates/system/host-name/node.def +++ b/templates/system/host-name/node.def @@ -1,7 +1,7 @@ type: txt help: Configure system host name default: "vyatta" -syntax:expression: pattern $VAR(@) "^[-a-zA-Z0-9.]+$" +syntax:expression: pattern $VAR(@) "^[[:alpha:]][-.[:alpha:]]*[[:alpha:]]$" ; "invalid host name $VAR(@)" update: sudo sh -c " \ hostname '$VAR(@)' -- cgit v1.2.3