]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Cater for non RFC conformant domains in the hostname field.
authorRoy Marples <roy@marples.name>
Fri, 28 Jun 2013 16:42:29 +0000 (16:42 +0000)
committerRoy Marples <roy@marples.name>
Fri, 28 Jun 2013 16:42:29 +0000 (16:42 +0000)
dhcpcd-hooks/30-hostname

index 77ae5fce9a854524ffdb8b03ae4a52170e574c3f..ede7503b4f643934025b4b19042844d37aecf22f 100644 (file)
@@ -71,7 +71,11 @@ set_hostname()
        if [ -n "$new_fqdn_name" ]; then
                try_hostname "$new_fqdn_name"
        elif [ -n "$new_host_name" ]; then
-               if [ -n "$new_domain_name" ]; then
+               # Could be non RFC conformant domain in the
+               # hostname field
+               if [ -n "$new_domain_name" -a \
+                   "$new_host_name" = "${new_host_name#*.}" ]
+               then
                        try_hostname "$new_host_name.$new_domain_name"
                else
                        try_hostname "$new_host_name"