summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2005-05-01 02:51:08 +0000
committerderaadt <deraadt@openbsd.org>2005-05-01 02:51:08 +0000
commit2f6fbbb0c0af99d0b63e3219e2ff74336bddacf0 (patch)
treeba17285bdf6b07c906dc1fd3c5a6f3d25f4c4e2c
parentuse setresgid() to drop privs, it is simply a better and less ambiguous API; (diff)
downloadwireguard-openbsd-2f6fbbb0c0af99d0b63e3219e2ff74336bddacf0.tar.xz
wireguard-openbsd-2f6fbbb0c0af99d0b63e3219e2ff74336bddacf0.zip
_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..
-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 */