Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/ypbind Check that the domain name is valid up front...
details: https://anonhg.NetBSD.org/src/rev/3b2c8babe279
branches: trunk
changeset: 765299:3b2c8babe279
user: dholland <dholland%NetBSD.org@localhost>
date: Tue May 24 06:57:04 2011 +0000
description:
Check that the domain name is valid up front, instead of doing it
after opening sockets and registering services and whatnot.
diffstat:
usr.sbin/ypbind/ypbind.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diffs (37 lines):
diff -r 7fba0ff03fc3 -r 3b2c8babe279 usr.sbin/ypbind/ypbind.c
--- a/usr.sbin/ypbind/ypbind.c Tue May 24 06:56:48 2011 +0000
+++ b/usr.sbin/ypbind/ypbind.c Tue May 24 06:57:04 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ypbind.c,v 1.69 2011/05/24 06:56:48 dholland Exp $ */
+/* $NetBSD: ypbind.c,v 1.70 2011/05/24 06:57:04 dholland Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt%fsa.ca@localhost>
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef LINT
-__RCSID("$NetBSD: ypbind.c,v 1.69 2011/05/24 06:56:48 dholland Exp $");
+__RCSID("$NetBSD: ypbind.c,v 1.70 2011/05/24 06:57:04 dholland Exp $");
#endif
#include <sys/types.h>
@@ -1060,6 +1060,8 @@
(void)yp_get_default_domain(&domainname);
if (domainname[0] == '\0')
errx(1, "Domainname not set. Aborting.");
+ if (_yp_invalid_domain(domainname))
+ errx(1, "Invalid domainname: %s", domainname);
/*
* Per traditional ypbind(8) semantics, if a ypservers
@@ -1145,9 +1147,6 @@
rmtcr.xdr_results = xdr_bool;
rmtcr.results_ptr = (caddr_t)(void *)&rmtcr_outval;
- if (_yp_invalid_domain(domainname))
- errx(1, "bad domainname: %s", domainname);
-
/* blow away old bindings in BINDINGDIR */
if (purge_bindingdir(BINDINGDIR) < 0)
errx(1, "unable to purge old bindings from %s", BINDINGDIR);
Home |
Main Index |
Thread Index |
Old Index