From d802774e02ed4a68d61b9fa3b95164221dd50112 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 8 Aug 2006 20:50:35 +0000 Subject: r17465: Get rid of add_initial_entry. In the two places it was called in it seemed a bit pointless to me. Volker (This used to be commit 244b25ae49d3c635fc54498dbee29f5b649ea1fa) --- source3/groupdb/mapping.c | 25 ---------------- source3/passdb/pdb_interface.c | 12 ++++---- source3/utils/net_groupmap.c | 66 +++++++++++++++++++++--------------------- 3 files changed, 40 insertions(+), 63 deletions(-) (limited to 'source3') diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c index 67b550680c..643c6e517c 100644 --- a/source3/groupdb/mapping.c +++ b/source3/groupdb/mapping.c @@ -133,31 +133,6 @@ static BOOL add_mapping_entry(GROUP_MAP *map, int flag) return True; } -/**************************************************************************** -initialise first time the mapping list -****************************************************************************/ -NTSTATUS add_initial_entry(gid_t gid, const char *sid, enum SID_NAME_USE sid_name_use, const char *nt_name, const char *comment) -{ - GROUP_MAP map; - - if(!init_group_mapping()) { - DEBUG(0,("failed to initialize group mapping\n")); - return NT_STATUS_UNSUCCESSFUL; - } - - map.gid=gid; - if (!string_to_sid(&map.sid, sid)) { - DEBUG(0, ("string_to_sid failed: %s", sid)); - return NT_STATUS_UNSUCCESSFUL; - } - - map.sid_name_use=sid_name_use; - fstrcpy(map.nt_name, nt_name); - fstrcpy(map.comment, comment); - - return pdb_add_group_mapping_entry(&map); -} - /**************************************************************************** Map a unix group to a newly created mapping ****************************************************************************/ diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index 6a9d072fbb..8d287cf2ec 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -584,7 +584,7 @@ static NTSTATUS pdb_default_create_dom_group(struct pdb_methods *methods, const char *name, uint32 *rid) { - DOM_SID group_sid; + GROUP_MAP map; struct group *grp; grp = getgrnam(name); @@ -611,10 +611,12 @@ static NTSTATUS pdb_default_create_dom_group(struct pdb_methods *methods, } } - sid_compose(&group_sid, get_global_sam_sid(), *rid); - - return add_initial_entry(grp->gr_gid, sid_string_static(&group_sid), - SID_NAME_DOM_GRP, name, NULL); + map.gid = grp->gr_gid; + map.sid_name_use = SID_NAME_DOM_GRP; + sid_compose(&map.sid, get_global_sam_sid(), *rid); + fstrcpy(map.nt_name, name); + map.comment[0] = '\0'; + return pdb_add_group_mapping_entry(&map); } NTSTATUS pdb_create_dom_group(TALLOC_CTX *mem_ctx, const char *name, diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c index 10ea8cce2a..fc16bb8e49 100644 --- a/source3/utils/net_groupmap.c +++ b/source3/utils/net_groupmap.c @@ -182,16 +182,12 @@ static int net_groupmap_list(int argc, const char **argv) static int net_groupmap_add(int argc, const char **argv) { - DOM_SID sid; - fstring ntgroup = ""; fstring unixgrp = ""; fstring string_sid = ""; fstring type = ""; - fstring ntcomment = ""; - enum SID_NAME_USE sid_type = SID_NAME_DOM_GRP; uint32 rid = 0; - gid_t gid; int i; + GROUP_MAP map; /* get the options */ for ( i=0; i