From: Roy Marples Date: Fri, 8 Aug 2008 12:26:05 +0000 (+0000) Subject: Ensure that hostname does not begin with a . X-Git-Tag: v4.0.2~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=caf08c91c9df09401fe1233706122210acb7d07e;p=thirdparty%2Fdhcpcd.git Ensure that hostname does not begin with a . --- diff --git a/dhcpcd.c b/dhcpcd.c index 889cf777..59de265e 100644 --- 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':