mirror of
https://github.com/samba-team/samba.git
synced 2025-07-29 15:42:04 +03:00
dsdb: Add test for the case of a link pointing back at its own object
This type of object was not possible to delete in Samba without first removing the link. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14306 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
@ -721,6 +721,31 @@ class LATests(samba.tests.TestCase):
|
||||
show_deactivated_link=0)
|
||||
|
||||
|
||||
def test_self_link(self):
|
||||
e1, = self.add_objects(1, 'group',
|
||||
'e_self_link')
|
||||
|
||||
guid = self.get_object_guid(e1)
|
||||
self.add_linked_attribute(e1, e1, attr="member")
|
||||
self.assert_forward_links(e1, [e1], attr='member')
|
||||
self.assert_back_links(e1, [e1], attr='memberOf')
|
||||
|
||||
try:
|
||||
self.samdb.delete(e1)
|
||||
except ldb.LdbError:
|
||||
# Cope with the current bug to make this a failure
|
||||
self.remove_linked_attribute(e1, e1, attr="member")
|
||||
self.samdb.delete(e1)
|
||||
self.fail("could not delete object with link to itself")
|
||||
|
||||
self.assert_forward_links('<GUID=%s>' % guid, [], attr='member',
|
||||
show_deleted=1)
|
||||
self.assert_forward_links('<GUID=%s>' % guid, [], attr='member',
|
||||
show_deactivated_link=0,
|
||||
show_deleted=1)
|
||||
self.assert_back_links('<GUID=%s>' % guid, [], attr='memberOf',
|
||||
show_deleted=1)
|
||||
|
||||
if "://" not in host:
|
||||
if os.path.isfile(host):
|
||||
host = "tdb://%s" % host
|
||||
|
Reference in New Issue
Block a user