summaryrefslogtreecommitdiff
path: root/usr.bin/passwd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-05-01 02:51:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-05-01 02:51:09 +0000
commit4a26595249aecfcb16c907855638847387c0aedf (patch)
tree945ec6cd43c23bcb39f6ecb7e3b8b4690188195b /usr.bin/passwd
parentc95bccb936556e0fd39a029d1dcd998c0691187d (diff)
_yp_check() is a non-standard API. it leaves the domain bound, and the
fd use for that too. We are only using it to check if YP is alive, so, unbind YP right after... this removes the reserved port socket fd in the child..
Diffstat (limited to 'usr.bin/passwd')
-rw-r--r--usr.bin/passwd/passwd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/passwd/passwd.c b/usr.bin/passwd/passwd.c
index 27b7a1ab7a1..cbd789986de 100644
--- a/usr.bin/passwd/passwd.c
+++ b/usr.bin/passwd/passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: passwd.c,v 1.18 2003/08/04 07:29:22 hin Exp $ */
+/* $OpenBSD: passwd.c,v 1.19 2005/05/01 02:51:08 deraadt Exp $ */
/*
* Copyright (c) 1988 The Regents of the University of California.
@@ -37,7 +37,7 @@ char copyright[] =
#ifndef lint
/*static const char sccsid[] = "from: @(#)passwd.c 5.5 (Berkeley) 7/6/91";*/
-static const char rcsid[] = "$OpenBSD: passwd.c,v 1.18 2003/08/04 07:29:22 hin Exp $";
+static const char rcsid[] = "$OpenBSD: passwd.c,v 1.19 2005/05/01 02:51:08 deraadt Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -84,6 +84,12 @@ main(int argc, char **argv)
#endif
#ifdef YP
use_yp = _yp_check(NULL);
+ if (use_yp) {
+ char *dom;
+
+ yp_get_default_domain(&dom);
+ yp_unbind(dom);
+ }
#endif
/* Process args and options */