r271256 fixed one segfault condition but introduced another due to the

wrong operator being used in the tty check.

Reported by:	avg@
MFH:		3 days
This commit is contained in:
Dag-Erling Smørgrav 2014-09-15 11:32:08 +00:00
parent 7965496958
commit 4c1d902bb2

View File

@ -86,7 +86,7 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags __unused,
return (PAM_SUCCESS);
PAM_VERBOSE_ERROR("%s is not allowed to log in from %s",
user, rhost);
} else if (tty != NULL || *(const char *)tty != '\0') {
} 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)