summaryrefslogtreecommitdiffstats
path: root/source3/utils/net.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-02-12 17:48:52 +0100
committerVolker Lendecke <vl@samba.org>2009-03-07 17:51:21 +0100
commit46bcb10b5abb21758cf234764b64220ede1b7ab5 (patch)
treec99007849f0599477797d3186c563f52d419513e /source3/utils/net.c
parente58ade4136b40d82c24f3556845e7412a3330992 (diff)
downloadsamba-46bcb10b5abb21758cf234764b64220ede1b7ab5.tar.gz
samba-46bcb10b5abb21758cf234764b64220ede1b7ab5.tar.xz
samba-46bcb10b5abb21758cf234764b64220ede1b7ab5.zip
Shape up pdb_search a bit by making it a talloc ctx with a destructor
Diffstat (limited to 'source3/utils/net.c')
-rw-r--r--source3/utils/net.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c
index d483198a9ed..7823a982195 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -272,7 +272,7 @@ static bool search_maxrid(struct pdb_search *search, const char *type,
num_entries = pdb_search_entries(search, 0, 0xffffffff, &entries);
for (i=0; i<num_entries; i++)
*max_rid = MAX(*max_rid, entries[i].rid);
- pdb_search_destroy(search);
+ TALLOC_FREE(search);
return true;
}
@@ -280,13 +280,14 @@ static uint32 get_maxrid(void)
{
uint32 max_rid = 0;
- if (!search_maxrid(pdb_search_users(0), "users", &max_rid))
+ if (!search_maxrid(pdb_search_users(talloc_tos(), 0), "users", &max_rid))
return 0;
- if (!search_maxrid(pdb_search_groups(), "groups", &max_rid))
+ if (!search_maxrid(pdb_search_groups(talloc_tos()), "groups", &max_rid))
return 0;
- if (!search_maxrid(pdb_search_aliases(get_global_sam_sid()),
+ if (!search_maxrid(pdb_search_aliases(talloc_tos(),
+ get_global_sam_sid()),
"aliases", &max_rid))
return 0;