summaryrefslogtreecommitdiff
path: root/usr.sbin/rpc.bootparamd/bootparamd.c
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2000-07-20 06:21:51 +0000
committerthorpej <thorpej@NetBSD.org>2000-07-20 06:21:51 +0000
commit29ea834f56c320cf1ef17e231ecac203b87cebef (patch)
treebe865a645e87fd63d5ce822e95519d069780e6be /usr.sbin/rpc.bootparamd/bootparamd.c
parent4b564fe2bf1cc728d4629c20ece4e23bf2020eb3 (diff)
If we don't get direct match on the token, only attempt to canonicalize
the token if it does not contain globbing characters, and just skip onto the next line if it does.
Diffstat (limited to 'usr.sbin/rpc.bootparamd/bootparamd.c')
-rw-r--r--usr.sbin/rpc.bootparamd/bootparamd.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/usr.sbin/rpc.bootparamd/bootparamd.c b/usr.sbin/rpc.bootparamd/bootparamd.c
index 198c685b4d9..074c3fc360d 100644
--- a/usr.sbin/rpc.bootparamd/bootparamd.c
+++ b/usr.sbin/rpc.bootparamd/bootparamd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bootparamd.c,v 1.35 2000/07/04 08:18:44 enami Exp $ */
+/* $NetBSD: bootparamd.c,v 1.36 2000/07/20 06:21:51 thorpej Exp $ */
/*
* This code is not copyright, and is placed in the public domain.
@@ -11,7 +11,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: bootparamd.c,v 1.35 2000/07/04 08:18:44 enami Exp $");
+__RCSID("$NetBSD: bootparamd.c,v 1.36 2000/07/20 06:21:51 thorpej Exp $");
#endif
#include <sys/types.h>
@@ -373,31 +373,34 @@ lookup_bootparam(client, client_canonical, id, server, path)
else
canon = word;
} else {
+ struct hostent *hp;
/*
* If it didn't match, try getting the
* canonical host name of the client
- * on this line and comparing that to
- * the client we are looking for
+ * on this line, if it's not a glob,
+ * and comparing it to the client we
+ * are looking up.
*/
- struct hostent *hp = gethostbyname(word);
- if (hp == NULL) {
+ if (HASGLOB(word)) {
+ if (debug)
+ warnx("Skipping non-match: %s",
+ word);
+ continue;
+ }
+ if ((hp = gethostbyname(word)) == NULL) {
if (debug)
warnx(
- "Unknown bootparams host %s", word);
+ "Unknown bootparams host %s",
+ word);
if (dolog)
syslog(LOG_NOTICE,
- "Unknown bootparams host %s", word);
+ "Unknown bootparams host %s",
+ word);
continue;
}
- if (fnmatch(word, hp->h_name,
- FNM_CASEFOLD) == 0) {
- /* See above. */
- if (HASGLOB(word))
- canon = hp->h_name;
- else
- canon = word;
- } else
+ if (strcasecmp(hp->h_name, client) != 0)
continue;
+ canon = hp->h_name;
}
#undef HASGLOB