forked from freeipa/freeipa
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add POSIX gidNumber for IPA groups in Global Catalog
Since groups in FreeIPA may be non-POSIX, only add gidNumber and the corresponding object class if the group is POSIX one. Define common macros in a separate template. Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
- Loading branch information
Showing
2 changed files
with
26 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% macro add_objectclass(attr, objectclass, entry, ns) -%} | ||
{%- if attr in entry -%} | ||
{%- if not (objectclass in ns.objectclasses) -%} | ||
{%- set ns.objectclasses = ns.objectclasses + [objectclass] -%} | ||
{%- endif -%} | ||
{%- endif -%} | ||
{%- endmacro -%} | ||
{%- macro print_attr(attr, entry) %} | ||
{%- if attr in entry -%} | ||
{%- for el in entry[attr] %} | ||
{{ attr }}: {{- el -}} | ||
{% endfor -%} | ||
{% endif -%} | ||
{% endmacro -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
{%- set ns = namespace(objectclasses=['top', 'ad-top', 'group', 'securityprincipal', 'nsmemberof', 'gcobject']) -%} | ||
{%- import "gc_base.tmpl" as base -%} | ||
{{- base.add_objectclass('gidnumber', 'posixgroup', entry, ns) -}} | ||
dn: cn={{ pkey }},cn=users,{{ suffix }} | ||
objectClass: top | ||
objectClass: ad-top | ||
objectClass: group | ||
objectClass: securityprincipal | ||
objectClass: nsmemberof | ||
objectClass: gcobject | ||
cn: {{ pkey }} | ||
{%- for el in ns.objectclasses %} | ||
objectclass: {{ el }} | ||
{%- endfor %} | ||
instanceType: 4 | ||
groupType: {{ groupType }} | ||
gcuuid: {{ entryuuid }} | ||
name: {{ pkey }} | ||
objectGUID:: {{ guid }} | ||
objectSid:: {{ sid }} | ||
sAMAccountName: {{ pkey }} | ||
sAMAccountName: {{ pkey }} | ||
sAMAccountType: 268435456 | ||
objectCategory: CN=Group,CN=Schema,CN=Configuration,{{ suffix }} | ||
ntsecuritydescriptor: D:(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)(A;;RPLCLORC;;;AU)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;AO)(A;;RPLCLORC;;;PS)(OA;;CR;ab721a55-1e2f-11d0-9819-00aa0040529b;;AU) | ||
{%- for member in entry['member'] %} | ||
member: {{ member }} | ||
{%- endfor %} | ||
{%- for group in entry['memberof'] %} | ||
memberof: {{ group }} | ||
{%- endfor %} | ||
groupType: {{ groupType }} | ||
gcuuid: {{ entryuuid }} | ||
{{- base.print_attr('member', entry) -}} | ||
{{- base.print_attr('memberof', entry) -}} | ||
{{- base.print_attr('gidnumber', entry) -}} |