[pve-devel] [PATCH access-control] jobs: realm sync: fix scheduled LDAP syncs not applying attributes correctly

Christoph Heiss c.heiss at proxmox.com
Tue Mar 19 14:48:43 CET 2024


This was reported by a user in the forum [0].

The cause was that the user-* standard options were not registered when
the sync was called from the scheduler, resulting in the following
error:

  pvescheduler[2849]: skipping attribute mapping 'cn'->'comment' for user 'test at samba0' - no such standard option 'user-comment'

Fix this by simply importing the PVE::API2::User module, thus ensuring
the options get registered.

[0] https://forum.proxmox.com/threads/ldap-integration-comment-email-first-name-lastname.143490/

Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
 src/PVE/Jobs/RealmSync.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PVE/Jobs/RealmSync.pm b/src/PVE/Jobs/RealmSync.pm
index 91235d5..4c77e55 100644
--- a/src/PVE/Jobs/RealmSync.pm
+++ b/src/PVE/Jobs/RealmSync.pm
@@ -13,6 +13,9 @@ use PVE::Tools ();
 
 use PVE::API2::Domains ();
 
+# load user-* standard options
+use PVE::API2::User ();
+
 use base qw(PVE::Job::Registry);
 
 sub type {
-- 
2.43.1





More information about the pve-devel mailing list