[pve-devel] [PATCH installer] Fix #1054: error on purely numeric hostnames

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Aug 2 15:00:11 CEST 2016


---
 proxinstall | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/proxinstall b/proxinstall
index d9fdabb..9813909 100755
--- a/proxinstall
+++ b/proxinstall
@@ -1680,6 +1680,13 @@ sub create_ipconf_view {
 
 	my $namere = "([a-zA-Z0-9]([a-zA-Z0-9\-]*[a-zA-Z0-9])?)";
 
+	# Debian does not support purely numeric hostnames
+	if ($text && $text =~ /^[0-9]+(?:\.|$)/) {
+	    display_message("Purely numeric hostnames are not allowed.");
+	    $hostentry->grab_focus();
+	    return;
+	}
+
  	if ($text && $text =~ m/^(${namere}\.)*${namere}$/ && $text !~ m/.domain.tld$/ &&
 	    $text =~ m/^([^\.]+)\.(\S+)$/) {
 	    $hostname = $1;
-- 
2.1.4





More information about the pve-devel mailing list