summaryrefslogtreecommitdiff
path: root/auth2-chall.c
diff options
context:
space:
mode:
authordtucker <dtucker>2005-01-20 11:20:50 +0000
committerdtucker <dtucker>2005-01-20 11:20:50 +0000
commit3a75b5a57f8f6e87f47ca81816ef93f82873f5bf (patch)
treea7f6a19d2f106fa13149af3022593b6e5b3f3bce /auth2-chall.c
parente3aec90f7838987cdff97b58f198910178e9511f (diff)
downloadopenssh-3a75b5a57f8f6e87f47ca81816ef93f82873f5bf.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.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);