diff options
author | Damien Miller <djm@mindrot.org> | 2003-05-14 15:11:48 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-05-14 15:11:48 +1000 |
commit | 4e448a31ae12e6f84caa7cdfc8b4c23db92459db (patch) | |
tree | 8f4c0885c8c91456b4d27d7f405e9125b83491a4 /auth-pam.c | |
parent | 9c617693c2250c62e5e326372bc783e3416a94b0 (diff) |
- (djm) Add new UsePAM configuration directive to allow runtime control
over usage of PAM. This allows non-root use of sshd when built with
--with-pam
Diffstat (limited to 'auth-pam.c')
-rw-r--r-- | auth-pam.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -49,6 +49,8 @@ RCSID("$FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48: #include "ssh2.h" #include "xmalloc.h" +extern ServerOptions options; + #define __unused #ifdef USE_POSIX_THREADS @@ -276,7 +278,6 @@ sshpam_cleanup(void *arg) static int sshpam_init(const char *user) { - extern ServerOptions options; extern u_int utmp_len; const char *pam_rhost, *pam_user; @@ -313,6 +314,10 @@ sshpam_init_ctx(Authctxt *authctxt) struct pam_ctxt *ctxt; int socks[2]; + /* Refuse to start if we don't have PAM enabled */ + if (!options.use_pam) + return NULL; + /* Initialize PAM */ if (sshpam_init(authctxt->user) == -1) { error("PAM: initialization failed"); |