libcli/security: handle node initialisation in one spot in insert_in_object_tree()
authorAndrew Bartlett <abartlet@samba.org>
Thu, 3 Jan 2013 09:40:32 +0000 (20:40 +1100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 28 Jan 2013 08:22:38 +0000 (09:22 +0100)
commitd0496c9ff74c0640dfd13c8dade51903a53c77b6
tree02cf7c172476203fda640954196853144794e60f
parent4f3f51eef1a9d1646c1d77c0f6f4e65fb6f38562
libcli/security: handle node initialisation in one spot in insert_in_object_tree()

This removes special-case for initalising the children array in
insert_in_object_tree().  talloc_realloc() handles the intial allocate
case perfectly well, so there is no need to have this duplicated.

This also restores having just one place were the rest of the elements
are intialised, to ensure uniform behaviour.

To do this, we have to rework insert_in_object_tree to have only one
output variable, both because having both root and new_node as output
variables was too confusing, and because otherwise the two pointers
were being allowed to point at the same memory.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 5b4e3de2bb25eeb85d72a886386c853cea3e9468)
libcli/security/access_check.h
libcli/security/object_tree.c
source4/dsdb/common/dsdb_access.c
source4/dsdb/samdb/ldb_modules/acl_util.c