summaryrefslogtreecommitdiff
path: root/auth2-chall.c
diff options
context:
space:
mode:
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 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);