]> git.proxmox.com Git - pve-access-control.git/commitdiff
fix realm sync permissions
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 20 Dec 2021 10:31:15 +0000 (11:31 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 20 Dec 2021 19:18:41 +0000 (20:18 +0100)
The userid-* permission check variants work on
$param->{userid} directly which does not exist for this
call. Also, they work on the realm of the user being
checked, rather than the realm provided as parameter.

The result was that as non-root user this always failed
with the message "userid '' too short"

Fix this by making the check explicitly work like in the
description.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/Domains.pm

index 9c2b2548028790f19baaa81bde4cf0f071bb7719..56e8394e0165787998081a2b76eeb2494a4b5ac9 100644 (file)
@@ -397,8 +397,8 @@ __PACKAGE__->register_method ({
        description => "'Realm.AllocateUser' on '/access/realm/<realm>' and "
            ." 'User.Modify' permissions to '/access/groups/'.",
        check => [ 'and',
-           [ 'userid-param', 'Realm.AllocateUser' ],
-           [ 'userid-group', ['User.Modify'] ],
+           ['perm', '/access/realm/{realm}', ['Realm.AllocateUser']],
+           ['perm', '/access/groups', ['User.Modify']],
        ],
     },
     description => "Syncs users and/or groups from the configured LDAP to user.cfg."