Project tree cycle checking logic is broken

Bug #1446834 reported by David Stanek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
David Stanek

Bug Description

The keystone.resource.backends.sql.Resource.list_projects_in_subtree method tries to check for cycles in the project hierarchy [1]. It's doing it wrong. This was not caught because there are no tests for it because you can't actually create cycles through the API.

There are two things we can do here:

1. Be satisfied that we don't allow cycles and remove the checks
2. Fix then and mock out the tests to fabricate cycles

[1] https://github.com/openstack/keystone/blob/master/keystone/resource/backends/sql.py#L97

David Stanek (dstanek)
description: updated
description: updated
Changed in keystone:
status: New → Confirmed
David Stanek (dstanek)
Changed in keystone:
assignee: nobody → David Stanek (dstanek)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/176304

Changed in keystone:
status: Confirmed → In Progress
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/176304
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=75d24e34698f94102b2445e68c4eb10767539c62
Submitter: Jenkins
Branch: master

commit 75d24e34698f94102b2445e68c4eb10767539c62
Author: David Stanek <email address hidden>
Date: Wed Apr 22 13:12:04 2015 +0000

    Fixes cyclic ref detection in project subtree

    The code was improperly using sets to detect circular references. This
    was not caught because there were no tests to exercise the behavior.

    Change-Id: Ie8dbd3567717ad63a3852d46367bb879dbe81472
    Closes-Bug: #1446834

Changed in keystone:
status: In Progress → Fix Committed
Changed in keystone:
milestone: none → liberty-1
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: liberty-1 → 8.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.