From 41d137eef81b59aa4d9a00e9208235c67f680ae2 Mon Sep 17 00:00:00 2001 From: Michal Fox Date: Sat, 3 Oct 2026 02:10:21 +0200 Subject: [PATCH] ldap: query groups: also return the description The description is a common attribute of groups, for example of groupOfNames in OpenLDAP, of groups in Active Directory and of user groups in FreeIPA. Query it together with the members and return it, so that the realm sync can use it as the comment of a synced group. Signed-off-by: Michal Fox --- src/PVE/LDAP.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PVE/LDAP.pm b/src/PVE/LDAP.pm index dd8d22a..84ddb35 100644 --- a/src/PVE/LDAP.pm +++ b/src/PVE/LDAP.pm @@ -210,7 +210,7 @@ sub query_groups { my $page = Net::LDAP::Control::Paged->new(size => 100); - my $attrs = ['member', 'uniqueMember']; + my $attrs = ['member', 'uniqueMember', 'description']; push @$attrs, $group_name_attr if $group_name_attr; my @args = ( base => $base_dn, @@ -247,6 +247,9 @@ sub query_groups { if ($group_name_attr && (my $name = $entry->get_value($group_name_attr))) { $group->{name} = $name; } + if (my $description = $entry->get_value('description')) { + $group->{description} = $description; + } push @$groups, $group; }