summaryrefslogtreecommitdiffstats
path: root/auth.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-05-14 15:11:48 +1000
committerDamien Miller <djm@mindrot.org>2003-05-14 15:11:48 +1000
commit4e448a31ae12e6f84caa7cdfc8b4c23db92459db (patch)
tree8f4c0885c8c91456b4d27d7f405e9125b83491a4 /auth.c
parent9c617693c2250c62e5e326372bc783e3416a94b0 (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.c')
-rw-r--r--auth.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/auth.c b/auth.c
index a17cc557..8b58cc67 100644
--- a/auth.c
+++ b/auth.c
@@ -78,8 +78,8 @@ allowed_user(struct passwd * pw)
#ifdef WITH_AIXAUTHENTICATE
char *loginmsg;
#endif /* WITH_AIXAUTHENTICATE */
-#if !defined(USE_PAM) && defined(HAVE_SHADOW_H) && \
- !defined(DISABLE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
+#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) && \
+ defined(HAS_SHADOW_EXPIRE)
struct spwd *spw;
time_t today;
#endif
@@ -88,10 +88,10 @@ allowed_user(struct passwd * pw)
if (!pw || !pw->pw_name)
return 0;
-#if !defined(USE_PAM) && defined(HAVE_SHADOW_H) && \
- !defined(DISABLE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
+#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) && \
+ defined(HAS_SHADOW_EXPIRE)
#define DAY (24L * 60 * 60) /* 1 day in seconds */
- if ((spw = getspnam(pw->pw_name)) != NULL) {
+ if (!options.use_pam && (spw = getspnam(pw->pw_name)) != NULL) {
today = time(NULL) / DAY;
debug3("allowed_user: today %d sp_expire %d sp_lstchg %d"
" sp_max %d", (int)today, (int)spw->sp_expire,