mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
pam: Fix rhost check when rhost is unavailable
Don't exit early if the rhost field isn't filled in, as it usually isn't
for a lot of services.
Fixes: 3274a31
This commit is contained in:
@ -477,13 +477,12 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
|
|||||||
|
|
||||||
pam_get_item(pamh, PAM_RHOST, (const void **)(const void*) &rhost);
|
pam_get_item(pamh, PAM_RHOST, (const void **)(const void*) &rhost);
|
||||||
|
|
||||||
if (rhost == NULL || *rhost == '\0') {
|
/* NULL or empty rhost if the host information is not available or set.
|
||||||
/* unavailable host information */
|
* "localhost" if the host is local.
|
||||||
return PAM_AUTHINFO_UNAVAIL;
|
* We want to not run for known remote hosts */
|
||||||
}
|
if (rhost != NULL &&
|
||||||
|
rhost != '\0' &&
|
||||||
if (strcmp (rhost, "localhost") != 0) {
|
strcmp (rhost, "localhost") != 0) {
|
||||||
/* remote login (e.g. over SSH) */
|
|
||||||
return PAM_AUTHINFO_UNAVAIL;
|
return PAM_AUTHINFO_UNAVAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user