summaryrefslogtreecommitdiffstats
path: root/lib/libpam
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2014-10-01 10:26:43 +0000
committerdes <des@FreeBSD.org>2014-10-01 10:26:43 +0000
commit6dff660c17910a0a9daadcedba96a1f38ed00dfd (patch)
tree94d5c8ea7273483aefecdee7c2035870b0ee7755 /lib/libpam
parent4204ff4f38d1156bc0e7717f8013b07db96497d7 (diff)
downloadFreeBSD-src-6dff660c17910a0a9daadcedba96a1f38ed00dfd.zip
FreeBSD-src-6dff660c17910a0a9daadcedba96a1f38ed00dfd.tar.gz
MFH (r272280, r272281, r272348): allow use with null user and rhost
PR: 83099 193927 Approved by: re (kib)
Diffstat (limited to 'lib/libpam')
-rw-r--r--lib/libpam/modules/pam_login_access/pam_login_access.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/libpam/modules/pam_login_access/pam_login_access.c b/lib/libpam/modules/pam_login_access/pam_login_access.c
index a29eb7d..fe16662 100644
--- a/lib/libpam/modules/pam_login_access/pam_login_access.c
+++ b/lib/libpam/modules/pam_login_access/pam_login_access.c
@@ -85,17 +85,21 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags __unused,
if (login_access(user, rhost) != 0)
return (PAM_SUCCESS);
PAM_VERBOSE_ERROR("%s is not allowed to log in from %s",
- user, rhost);
+ (const char *)user, (const char *)rhost);
} else if (tty != NULL && *(const char *)tty != '\0') {
PAM_LOG("Checking login.access for user %s on tty %s",
(const char *)user, (const char *)tty);
if (login_access(user, tty) != 0)
return (PAM_SUCCESS);
PAM_VERBOSE_ERROR("%s is not allowed to log in on %s",
- user, tty);
+ (const char *)user, (const char *)tty);
} else {
- PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required");
- return (PAM_AUTHINFO_UNAVAIL);
+ PAM_LOG("Checking login.access for user %s",
+ (const char *)user);
+ if (login_access(user, "***unknown***") != 0)
+ return (PAM_SUCCESS);
+ PAM_VERBOSE_ERROR("%s is not allowed to log in",
+ (const char *)user);
}
return (PAM_AUTH_ERR);
OpenPOWER on IntegriCloud