From: deraadt Date: Sun, 17 Jul 2022 03:10:47 +0000 (+0000) Subject: since yp_bind() and yp_all() don't use open, fstat, read, socket, and other X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=fa136f0389f3685de9d2a20d99ff580a276303aa;p=openbsd since yp_bind() and yp_all() don't use open, fstat, read, socket, and other rich system calls to perform YP/LDAP lookups, there is no need to access() /var/run/ypbind.lock to "hint" to pledge that it should open up those system calls. ok jmatthew, miod --- diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c index ab5544f24f1..3b7c65bfdeb 100644 --- a/lib/libc/gen/getgrent.c +++ b/lib/libc/gen/getgrent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getgrent.c,v 1.48 2019/07/02 15:54:05 deraadt Exp $ */ +/* $OpenBSD: getgrent.c,v 1.49 2022/07/17 03:10:47 deraadt Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -197,10 +197,6 @@ DEF_WEAK(getgrgid_r); static int start_gr(void) { -#ifdef YP - int saved_errno = errno; -#endif - if (_gr_fp) { rewind(_gr_fp); #ifdef YP @@ -214,15 +210,6 @@ start_gr(void) return(1); } -#ifdef YP - /* - * Hint to the kernel that a passwd database operation is happening. - */ - saved_errno = errno; - (void)access("/var/run/ypbind.lock", R_OK); - errno = saved_errno; -#endif - return((_gr_fp = fopen(_PATH_GROUP, "re")) ? 1 : 0); } diff --git a/lib/libc/gen/getgrouplist.c b/lib/libc/gen/getgrouplist.c index d0701dffb17..b390449eef2 100644 --- a/lib/libc/gen/getgrouplist.c +++ b/lib/libc/gen/getgrouplist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getgrouplist.c,v 1.28 2019/07/02 15:54:05 deraadt Exp $ */ +/* $OpenBSD: getgrouplist.c,v 1.29 2022/07/17 03:10:47 deraadt Exp $ */ /* * Copyright (c) 2008 Ingo Schwarze * Copyright (c) 1991, 1993 @@ -149,9 +149,6 @@ getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt) int *skipyp = &foundyp; extern struct group *_getgrent_yp(int *); struct group *grp; -#ifdef YP - int saved_errno; -#endif /* * install primary group @@ -162,15 +159,6 @@ getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt) } groups[ngroups++] = agroup; -#ifdef YP - /* - * Hint to the kernel that a passwd database operation is happening. - */ - saved_errno = errno; - (void)access("/var/run/ypbind.lock", R_OK); - errno = saved_errno; -#endif - /* * Scan the group file to find additional groups. */ diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 435a9c45c42..7ddbe332e4c 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getpwent.c,v 1.64 2021/12/07 18:13:45 deraadt Exp $ */ +/* $OpenBSD: getpwent.c,v 1.65 2022/07/17 03:10:47 deraadt Exp $ */ /* * Copyright (c) 2008 Theo de Raadt * Copyright (c) 1988, 1993 @@ -969,12 +969,6 @@ __initdb(int shadow) int saved_errno = errno; #ifdef YP - /* - * Hint to the kernel that a passwd database operation is happening. - */ - (void)access("/var/run/ypbind.lock", R_OK); - errno = saved_errno; - __ypmode = YPMODE_NONE; __getpwent_has_yppw = -1; #endif