mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-10-04 08:21:57 +00:00
pam: set PAM_RHOST
This allows pam modules to restrict users by host. For instance, you could restrict root@pam to only 127.0.0.1. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
9d2996034d
commit
6c512352ae
@ -43,6 +43,12 @@ sub authenticate_user {
|
||||
die "error during PAM init: $err";
|
||||
}
|
||||
|
||||
if (my $rpcenv = PVE::RPCEnvironment::get()) {
|
||||
if (my $ip = $rpcenv->get_client_ip()) {
|
||||
$pamh->pam_set_item(PAM_RHOST(), $ip);
|
||||
}
|
||||
}
|
||||
|
||||
my $res;
|
||||
|
||||
if (($res = $pamh->pam_authenticate(0)) != PAM_SUCCESS) {
|
||||
|
Loading…
Reference in New Issue
Block a user