diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2017-12-03 16:09:15 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2017-12-03 16:09:15 +0000 |
commit | 2286df923da16c107a4317f215cf3eb6fd0289ab (patch) | |
tree | c02c574ee61428fbc58ac0b7161c2abe58bb6b0c /sbin/dhclient | |
parent | f7e3b64e44e7051dbb9b6bc6566050e5de4db8b3 (diff) |
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@
Diffstat (limited to 'sbin/dhclient')
-rw-r--r-- | sbin/dhclient/dhclient.c | 31 |
1 files changed, 1 insertions, 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 <henning@openbsd.org> @@ -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' |