Skip to content

Commit

Permalink
Add POSIX gidNumber for IPA groups in Global Catalog
Browse files Browse the repository at this point in the history
Since groups in FreeIPA may be non-POSIX, only add gidNumber and the
corresponding object class if the group is POSIX one.

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
  • Loading branch information
abbra committed Jun 13, 2023
1 parent 3886123 commit fd81beb
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions ipaserver/globalcatalog/templates/gc_group_template.tmpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{% set objectclasses = ['top', 'ad-top', 'group', 'securityprincipal', 'nsmemberof', 'gcobject'] -%}
{% macro first_val(attr) -%}
{{ entry[attr][0] }}
{%- endmacro %}
{% macro add_element(attr, objectclass) -%}
{%- if attr in entry -%}
{{ attr }}: {{ entry[attr][0] }}
{%- if objectclass not in objectclasses -%}
{%- set objectclasses = objectclasses + [objectclass] -%}
{%- endif %}
{%- endif %}
{%- endmacro %}
dn: cn={{ pkey }},cn=users,{{ suffix }}
objectClass: top
objectClass: ad-top
objectClass: group
objectClass: securityprincipal
objectClass: nsmemberof
objectClass: gcobject
cn: {{ pkey }}
instanceType: 4
name: {{ pkey }}
Expand All @@ -20,5 +26,9 @@ member: {{ member }}
{%- for group in entry['memberof'] %}
memberof: {{ group }}
{%- endfor %}
{{ add_element('gidnumber', 'posixgroup') }}
groupType: {{ groupType }}
gcuuid: {{ entryuuid }}
{%- for objectclass in objectclasses %}
objectclass: {{ objectclass }}
{%- endfor -%}

0 comments on commit fd81beb

Please sign in to comment.