summaryrefslogtreecommitdiff
path: root/auth2-chall.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-01-20 22:20:50 +1100
committerDarren Tucker <dtucker@zip.com.au>2005-01-20 22:20:50 +1100
commit3c66080aa26e5121805c80728a9c801b08a7870e (patch)
tree350a6cd92438b1ad876622b92557be577e8457b7 /auth2-chall.c
parent33bc334a8bb6f20ca659f7d4f4669a04d54bd2e8 (diff)
- (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.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/auth2-chall.c b/auth2-chall.c
index 29234439c..384a543ee 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 $");
32#include "xmalloc.h" 32#include "xmalloc.h"
33#include "dispatch.h" 33#include "dispatch.h"
34#include "log.h" 34#include "log.h"
35#include "servconf.h"
36
37/* import */
38extern ServerOptions options;
35 39
36static int auth2_challenge_start(Authctxt *); 40static int auth2_challenge_start(Authctxt *);
37static int send_userauth_info_request(Authctxt *); 41static int send_userauth_info_request(Authctxt *);
@@ -71,6 +75,21 @@ struct KbdintAuthctxt
71 u_int nreq; 75 u_int nreq;
72}; 76};
73 77
78#ifdef USE_PAM
79void
80remove_kbdint_device(const char *devname)
81{
82 int i, j;
83
84 for (i = 0; devices[i] != NULL; i++)
85 if (strcmp(devices[i]->name, devname) == 0) {
86 for (j = i; devices[j] != NULL; j++)
87 devices[j] = devices[j+1];
88 i--;
89 }
90}
91#endif
92
74static KbdintAuthctxt * 93static KbdintAuthctxt *
75kbdint_alloc(const char *devs) 94kbdint_alloc(const char *devs)
76{ 95{
@@ -78,6 +97,11 @@ kbdint_alloc(const char *devs)
78 Buffer b; 97 Buffer b;
79 int i; 98 int i;
80 99
100#ifdef USE_PAM
101 if (!options.use_pam)
102 remove_kbdint_device("pam");
103#endif
104
81 kbdintctxt = xmalloc(sizeof(KbdintAuthctxt)); 105 kbdintctxt = xmalloc(sizeof(KbdintAuthctxt));
82 if (strcmp(devs, "") == 0) { 106 if (strcmp(devs, "") == 0) {
83 buffer_init(&b); 107 buffer_init(&b);