Bug 439450 - memberOf: A circular grouping causes groups to be listed as memberOf themselves
memberOf: A circular grouping causes groups to be listed as memberOf themselves
Product: 389
Classification: Community
Component: Server - memberOf Plug-in (Show other bugs)
All Linux
high Severity high
: ---
: ---
Assigned To: Nathan Kinder
Chandrasekar Kannan
Depends On:
Blocks: 249650 429034 FDS1.2.0
  Show dependency treegraph
Reported: 2008-03-28 14:29 EDT by Nathan Kinder
Modified: 2015-01-04 18:31 EST (History)
2 users (show)

See Also:
Fixed In Version: 8.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-04-29 19:03:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
CVS Diffs (2.85 KB, patch)
2008-03-28 17:07 EDT, Nathan Kinder
no flags Details | Diff

  None (edit)
Description Nathan Kinder 2008-03-28 14:29:02 EDT
If you create a circular grouping (two groups with each other listed as
members), then each group will have itself listed as the value of a memberOf
attribute.  We don't prevent someone from creating a circular grouping, but we
shouldn't list a group as a memberOf itself.
Comment 1 Nathan Kinder 2008-03-28 16:30:18 EDT
To reproduce:

- Create the following two group entries:

  dn: cn=group1,dc=example,dc=com
  objectclass: top
  objectClass: groupOfNames
  objectClass: inetUser
  cn: group1

  dn: cn=group2,dc=example,dc=com
  objectclass: top
  objectClass: groupOfNames
  objectClass: inetUser
  cn: group2

- Make group2 a member of group1:

  dn: cn=group1,dc=example,dc=com
  changetype: modify
  add: member
  member: cn=group2,dc=example,dc=com

- Make group1 a member of group2:

  dn: cn=group2,dc=example,dc=com
  changetype: modify
  add: member
  member: cn=group1,dc=example,dc=com

- At this point, both groups will have themselves listed as a member:

  dn: cn=group1,dc=example,dc=com
  member: cn=group2,dc=example,dc=com
  memberof: cn=group1,dc=example,dc=com
  memberof: cn=group2,dc=example,dc=com

  dn: cn=group2,dc=example,dc=com
  member: cn=group1,dc=example,dc=com
  memberof: cn=group1,dc=example,dc=com
  memberof: cn=group2,dc=example,dc=com
Comment 2 Nathan Kinder 2008-03-28 17:07:08 EDT
Created attachment 299521 [details]
CVS Diffs

When we are done recursing through a nested group, we finally update the group
entry itself.  Before doing any update to the group entry itself, we should
check to see if we're trying to do do an operation on the entry using itself as
the value for memberOf.  There was a similar check in the code already, but it
was only for a fixup operation for add modify operations.  This check needs to
be performed for all modify operation types earlier in the code.
Comment 3 Nathan Kinder 2008-03-28 17:46:15 EDT
Checked into ldapserver (HEAD).  Thanks to Simo for his review!

Checking in memberof.c;
/cvs/dirsec/ldapserver/ldap/servers/plugins/memberof/memberof.c,v  <--  memberof.c
new revision: 1.4; previous revision: 1.3
Comment 4 Nathan Kinder 2008-03-28 17:46:33 EDT
Checked into FreeIPA as changeset 745.
Comment 5 Yi Zhang 2008-04-04 14:09:13 EDT
qa verified, bug closed
build used: 4-4-2008 daily build
Comment 7 Chandrasekar Kannan 2009-04-29 19:03:27 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.