From 4a26595249aecfcb16c907855638847387c0aedf Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 1 May 2005 02:51:09 +0000 Subject: _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.. --- usr.bin/passwd/passwd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'usr.bin/passwd') 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 @@ -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 */ -- cgit v1.2.3