]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Ensure that hostname does not begin with a .
authorRoy Marples <roy@marples.name>
Fri, 8 Aug 2008 12:26:05 +0000 (12:26 +0000)
committerRoy Marples <roy@marples.name>
Fri, 8 Aug 2008 12:26:05 +0000 (12:26 +0000)
dhcpcd.c

index 889cf7778eec51e7aae89324bbff03c8d28025c8..59de265ebfe152e9681216e948e348b4f7b7a457 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -332,6 +332,10 @@ parse_option(int opt, char *oarg, struct options *options)
                        logger(LOG_ERR, "hostname: %s", strerror(errno));
                        return -1;
                }
+               if (s != 0 && options->hostname[1] == '.') {
+                       logger(LOG_ERR, "hostname cannot begin with a .");
+                       return -1;
+               }
                options->hostname[0] = (uint8_t)s;
                break;
        case 'i':