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 <me@dualfroz.com>
This commit is contained in:
dualfroz committed 2026-10-03 02:10:21 +02:00
1 parent eafdc1c6ac
commit 41d137eef8
1 file changed
+4 -1
+4 -1
View File
@@ -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;
}