]> git.proxmox.com Git - pve-access-control.git/commitdiff
fix user deletion when realm does not enforce TFA
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 19 Oct 2021 11:52:42 +0000 (13:52 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 21 Oct 2021 10:27:42 +0000 (12:27 +0200)
here the existance of the user is only interesting if we want to set
data, not if we delete it.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/AccessControl.pm

index fcb16bd2dbeceeab5268aa8c9cf7c931d7779ac7..347c2a8071b3d8d0b31b7679220a5c856b7c7055 100644 (file)
@@ -1628,7 +1628,7 @@ sub user_set_tfa {
            die "realm '$realm' does not allow removing the 2nd factor\n" if defined($user);
        }
     } else {
-       die "user '$userid' not found\n" if !defined($user);
+       die "user '$userid' not found\n" if !defined($user) && defined($data);
        # Without a realm-enforced TFA setting the user can add a u2f or totp entry by themselves.
        # The 'yubico' type requires yubico server settings, which have to be configured on the
        # realm, so this is not supported here: