Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/rpc.bootparamd If -s and/or -d set, report invalid ...



details:   https://anonhg.NetBSD.org/src/rev/809815dae896
branches:  trunk
changeset: 472241:809815dae896
user:      abs <abs%NetBSD.org@localhost>
date:      Mon Apr 26 02:35:17 1999 +0000

description:
If -s and/or -d set, report invalid host entries in bootparams when parsed.
Currently an invalid entry will cause any subsequent entries to fail
if hostlookups take take several seconds (This can happen with DNS).
Now we can more easily detect this situation.

diffstat:

 usr.sbin/rpc.bootparamd/bootparamd.c |  16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 4c349358710d -r 809815dae896 usr.sbin/rpc.bootparamd/bootparamd.c
--- a/usr.sbin/rpc.bootparamd/bootparamd.c      Mon Apr 26 02:20:02 1999 +0000
+++ b/usr.sbin/rpc.bootparamd/bootparamd.c      Mon Apr 26 02:35:17 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootparamd.c,v 1.18 1999/03/24 22:01:38 nathanw Exp $  */
+/*     $NetBSD: bootparamd.c,v 1.19 1999/04/26 02:35:17 abs 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.18 1999/03/24 22:01:38 nathanw Exp $");
+__RCSID("$NetBSD: bootparamd.c,v 1.19 1999/04/26 02:35:17 abs Exp $");
 #endif
 
 #include <sys/types.h>
@@ -341,8 +341,16 @@
                                 * the client we are looking for
                                 */
                                struct hostent *hp = gethostbyname(word);
-                               if (hp == NULL ||
-                                   strcasecmp(hp->h_name, client))
+                               if (hp == NULL ) {
+                                       if (debug)
+                                               warnx(
+                                           "Unknown bootparams host %s", word);
+                                       if (dolog)
+                                               syslog(LOG_NOTICE,
+                                           "Unknown bootparams host %s", word);
+                                       continue;
+                               }
+                               if (strcasecmp(hp->h_name, client))
                                        continue;
                        }
                        contin *= -1;



Home | Main Index | Thread Index | Old Index