Lines 79-85
Link Here
|
79 |
|
79 |
|
80 |
gethostname(hostname, sizeof hostname); |
80 |
gethostname(hostname, sizeof hostname); |
81 |
|
81 |
|
82 |
if (rhost == NULL || *(const char *)rhost == '\0') { |
82 |
if (rhost != NULL && *(const char *)rhost != '\0') { |
|
|
83 |
PAM_LOG("Checking login.access for user %s from host %s", |
84 |
(const char *)user, (const char *)rhost); |
85 |
if (login_access(user, rhost) != 0) |
86 |
return (PAM_SUCCESS); |
87 |
PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", |
88 |
user, rhost); |
89 |
} else if (tty != NULL || *(const char *)tty != '\0') { |
83 |
PAM_LOG("Checking login.access for user %s on tty %s", |
90 |
PAM_LOG("Checking login.access for user %s on tty %s", |
84 |
(const char *)user, (const char *)tty); |
91 |
(const char *)user, (const char *)tty); |
85 |
if (login_access(user, tty) != 0) |
92 |
if (login_access(user, tty) != 0) |
Lines 87-98
Link Here
|
87 |
PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", |
94 |
PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", |
88 |
user, tty); |
95 |
user, tty); |
89 |
} else { |
96 |
} else { |
90 |
PAM_LOG("Checking login.access for user %s from host %s", |
97 |
PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required"); |
91 |
(const char *)user, (const char *)rhost); |
98 |
return (PAM_AUTHINFO_UNAVAIL); |
92 |
if (login_access(user, rhost) != 0) |
|
|
93 |
return (PAM_SUCCESS); |
94 |
PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", |
95 |
user, rhost); |
96 |
} |
99 |
} |
97 |
|
100 |
|
98 |
return (PAM_AUTH_ERR); |
101 |
return (PAM_AUTH_ERR); |