summaryrefslogtreecommitdiff
path: root/lib/libc/gen/getgrent.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2015-11-24 22:03:34 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2015-11-24 22:03:34 +0000
commita50c5c6d0278c1f74811d7af263f0a1da4572ef4 (patch)
treed0e56de3e26b5f1fd044285e3c541d6769b1bd32 /lib/libc/gen/getgrent.c
parentaa7d58417b2629d9f94ae2572e2f74542c3ea214 (diff)
Use reentrant versions of getpw{nam,uid} and getgr{nam,gid} within
libc to avoid reusing the static buffers returned by the non-reentrant versions. Since this is inside libc we can use constants for the buffer sizes instead of having to call sysconf(). OK guenther@ deraadt@
Diffstat (limited to 'lib/libc/gen/getgrent.c')
-rw-r--r--lib/libc/gen/getgrent.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index e42fd57bc7d..624a9c06110 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getgrent.c,v 1.44 2015/09/14 16:09:13 tedu Exp $ */
+/* $OpenBSD: getgrent.c,v 1.45 2015/11/24 22:03:33 millert Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -170,7 +170,6 @@ getgrgid(gid_t gid)
return getgrgid_gs(gid, p_gr, gs);
}
-DEF_WEAK(getgrgid);
int
getgrgid_r(gid_t gid, struct group *grp, char *buffer, size_t bufsize,
@@ -191,6 +190,7 @@ getgrgid_r(gid_t gid, struct group *grp, char *buffer, size_t bufsize,
errno = errnosave;
return ret;
}
+DEF_WEAK(getgrgid_r);
static int
start_gr(void)