diff options
author | Darren Tucker <dtucker@zip.com.au> | 2005-01-20 22:20:50 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2005-01-20 22:20:50 +1100 |
commit | 3c66080aa26e5121805c80728a9c801b08a7870e (patch) | |
tree | 350a6cd92438b1ad876622b92557be577e8457b7 /auth2-chall.c | |
parent | 33bc334a8bb6f20ca659f7d4f4669a04d54bd2e8 (diff) | |
download | openssh-git-3c66080aa26e5121805c80728a9c801b08a7870e.tar.gz |
- (dtucker) [auth-chall.c auth.h auth2-chall.c] Bug #936: Remove pam from
the list of available kbdint devices if UsePAM=no. ok djm@
Diffstat (limited to 'auth2-chall.c')
-rw-r--r-- | auth2-chall.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/auth2-chall.c b/auth2-chall.c index 29234439..384a543e 100644 --- a/auth2-chall.c +++ b/auth2-chall.c @@ -32,6 +32,10 @@ RCSID("$OpenBSD: auth2-chall.c,v 1.22 2005/01/19 13:11:47 dtucker Exp $"); #include "xmalloc.h" #include "dispatch.h" #include "log.h" +#include "servconf.h" + +/* import */ +extern ServerOptions options; static int auth2_challenge_start(Authctxt *); static int send_userauth_info_request(Authctxt *); @@ -71,6 +75,21 @@ struct KbdintAuthctxt u_int nreq; }; +#ifdef USE_PAM +void +remove_kbdint_device(const char *devname) +{ + int i, j; + + for (i = 0; devices[i] != NULL; i++) + if (strcmp(devices[i]->name, devname) == 0) { + for (j = i; devices[j] != NULL; j++) + devices[j] = devices[j+1]; + i--; + } +} +#endif + static KbdintAuthctxt * kbdint_alloc(const char *devs) { @@ -78,6 +97,11 @@ kbdint_alloc(const char *devs) Buffer b; int i; +#ifdef USE_PAM + if (!options.use_pam) + remove_kbdint_device("pam"); +#endif + kbdintctxt = xmalloc(sizeof(KbdintAuthctxt)); if (strcmp(devs, "") == 0) { buffer_init(&b); |