summaryrefslogtreecommitdiff
path: root/auth-pam.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth-pam.c')
-rw-r--r--auth-pam.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/auth-pam.c b/auth-pam.c
index f4718035d..234e8f435 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -49,6 +49,8 @@ RCSID("$FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:
49#include "ssh2.h" 49#include "ssh2.h"
50#include "xmalloc.h" 50#include "xmalloc.h"
51 51
52extern ServerOptions options;
53
52#define __unused 54#define __unused
53 55
54#ifdef USE_POSIX_THREADS 56#ifdef USE_POSIX_THREADS
@@ -276,7 +278,6 @@ sshpam_cleanup(void *arg)
276static int 278static int
277sshpam_init(const char *user) 279sshpam_init(const char *user)
278{ 280{
279 extern ServerOptions options;
280 extern u_int utmp_len; 281 extern u_int utmp_len;
281 const char *pam_rhost, *pam_user; 282 const char *pam_rhost, *pam_user;
282 283
@@ -313,6 +314,10 @@ sshpam_init_ctx(Authctxt *authctxt)
313 struct pam_ctxt *ctxt; 314 struct pam_ctxt *ctxt;
314 int socks[2]; 315 int socks[2];
315 316
317 /* Refuse to start if we don't have PAM enabled */
318 if (!options.use_pam)
319 return NULL;
320
316 /* Initialize PAM */ 321 /* Initialize PAM */
317 if (sshpam_init(authctxt->user) == -1) { 322 if (sshpam_init(authctxt->user) == -1) {
318 error("PAM: initialization failed"); 323 error("PAM: initialization failed");