From 2ae18f40a70632eb87eca114980649dae8c476ff Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Fri, 22 Mar 2002 01:24:38 +0000 Subject: - provos@cvs.openbsd.org 2002/03/17 20:25:56 [auth.c auth.h auth1.c auth2.c] getpwnamallow returns struct passwd * only if user valid; okay markus@ --- auth.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'auth.c') diff --git a/auth.c b/auth.c index de004515..19ef605f 100644 --- a/auth.c +++ b/auth.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth.c,v 1.36 2002/03/15 11:00:38 itojun Exp $"); +RCSID("$OpenBSD: auth.c,v 1.37 2002/03/17 20:25:56 provos Exp $"); #ifdef HAVE_LOGIN_H #include @@ -439,3 +439,15 @@ secure_filename(FILE *f, const char *file, struct passwd *pw, } return 0; } + +struct passwd * +getpwnamallow(const char *user) +{ + struct passwd *pw; + + pw = getpwnam(user); + if (pw != NULL && !allowed_user(pw)) + pw = NULL; + + return (pw); +} -- cgit v1.2.3