diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2002-03-22 01:24:38 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2002-03-22 01:24:38 +0000 |
commit | 2ae18f40a70632eb87eca114980649dae8c476ff (patch) | |
tree | f9d5dd660441f05c1ff96c48eda5e626b06c69f3 /auth.c | |
parent | eacc71b558d29c243ea540c3d6acd2cf6ca15552 (diff) |
- 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@
Diffstat (limited to 'auth.c')
-rw-r--r-- | auth.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: auth.c,v 1.36 2002/03/15 11:00:38 itojun Exp $"); | 26 | RCSID("$OpenBSD: auth.c,v 1.37 2002/03/17 20:25:56 provos Exp $"); |
27 | 27 | ||
28 | #ifdef HAVE_LOGIN_H | 28 | #ifdef HAVE_LOGIN_H |
29 | #include <login.h> | 29 | #include <login.h> |
@@ -439,3 +439,15 @@ secure_filename(FILE *f, const char *file, struct passwd *pw, | |||
439 | } | 439 | } |
440 | return 0; | 440 | return 0; |
441 | } | 441 | } |
442 | |||
443 | struct passwd * | ||
444 | getpwnamallow(const char *user) | ||
445 | { | ||
446 | struct passwd *pw; | ||
447 | |||
448 | pw = getpwnam(user); | ||
449 | if (pw != NULL && !allowed_user(pw)) | ||
450 | pw = NULL; | ||
451 | |||
452 | return (pw); | ||
453 | } | ||