From 17329c1dbe09b488427e6cdeec99e86add9b8fc1 Mon Sep 17 00:00:00 2001 From: krw Date: Sun, 3 Dec 2017 16:09:14 +0000 Subject: [PATCH] Abandon nagging about "_" violating RFC 952. This removes the need for a custom res_hnok(), so just use the libc version of res_hnok(). Requested by deraadt@ --- sbin/dhclient/dhclient.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index d6c62002861..5124421d474 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.530 2017/11/27 13:13:19 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.531 2017/12/03 16:09:14 krw Exp $ */ /* * Copyright 2004 Henning Brauer @@ -129,7 +129,6 @@ struct proposal { void sighdlr(int); void usage(void); -int res_hnok(const char *dn); int res_hnok_list(const char *dn); int addressinuse(char *, struct in_addr, char *); @@ -2055,34 +2054,6 @@ rdaemon(int devnull) return 0; } -int -res_hnok(const char *name) -{ - const char *dn = name; - int pch = '.', ch = (unsigned char)*dn++; - int warn = 0; - - while (ch != '\0') { - int nch = (unsigned char)*dn++; - - if (ch == '.') { - ; - } else if (pch == '.' || nch == '.' || nch == '\0') { - if (isalnum(ch) == 0) - return 0; - } else if (isalnum(ch) == 0 && ch != '-' && ch != '_') { - return 0; - } else if (ch == '_' && warn == 0) { - log_warnx("%s: warning: hostname %s contains an " - "underscore which violates RFC 952", log_procname, - name); - warn++; - } - pch = ch, ch = nch; - } - return 1; -} - /* * resolv_conf(5) says a max of DHCP_DOMAIN_SEARCH_CNT domains and total * length of DHCP_DOMAIN_SEARCH_LEN bytes are acceptable for the 'search' -- 2.20.1