summaryrefslogtreecommitdiff
path: root/lib/libwrap
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2005-04-10 08:05:40 +0000
committerchristos <christos@NetBSD.org>2005-04-10 08:05:40 +0000
commitc4402ab05ecbfa78a7569a9d61fa387718007d53 (patch)
treedb2060088797e2874e0f385f1606673ce7f62c7f /lib/libwrap
parent7b5f51876da2b390449f22737e5e2c7640bf25db (diff)
Use getpwnam_r; from John Nemeth
Diffstat (limited to 'lib/libwrap')
-rw-r--r--lib/libwrap/options.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libwrap/options.c b/lib/libwrap/options.c
index 4eb3f4f38ae..83301764750 100644
--- a/lib/libwrap/options.c
+++ b/lib/libwrap/options.c
@@ -1,4 +1,4 @@
-/* $NetBSD: options.c,v 1.11 2002/05/24 05:38:20 itojun Exp $ */
+/* $NetBSD: options.c,v 1.12 2005/04/10 08:05:40 christos Exp $ */
/*
* General skeleton for adding options to the access control language. The
@@ -35,7 +35,7 @@
#if 0
static char sccsid[] = "@(#) options.c 1.17 96/02/11 17:01:31";
#else
-__RCSID("$NetBSD: options.c,v 1.11 2002/05/24 05:38:20 itojun Exp $");
+__RCSID("$NetBSD: options.c,v 1.12 2005/04/10 08:05:40 christos Exp $");
#endif
#endif
@@ -292,12 +292,13 @@ static void user_option(value, request)
char *value;
struct request_info *request;
{
- struct passwd *pwd;
+ struct passwd *pwd, pws;
char *group;
+ char pwbuf[1024];
if ((group = split_at(value, '.')) != 0)
group_option(group, request);
- if ((pwd = getpwnam(value)) == 0)
+ if (getpwnam_r(value, &pws, pwbuf, sizeof(pwbuf), &pwd) != 0)
tcpd_jump("unknown user: \"%s\"", value);
endpwent();