diff options
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 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 */ | ||
38 | extern ServerOptions options; | ||
35 | 39 | ||
36 | static int auth2_challenge_start(Authctxt *); | 40 | static int auth2_challenge_start(Authctxt *); |
37 | static int send_userauth_info_request(Authctxt *); | 41 | static 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 | ||
79 | void | ||
80 | remove_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 | |||
74 | static KbdintAuthctxt * | 93 | static KbdintAuthctxt * |
75 | kbdint_alloc(const char *devs) | 94 | kbdint_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); |