From e1e62d89999629d41cc2b66b12eb37ce190d5db0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 8 Aug 2006 19:29:34 +0000 Subject: r17463: A bit of cleanup work: Remove some unused code: pdb_find_alias is not used anymore, and nobody I think has ever used the pdb_nop operations for group mapping. smbpasswd and tdb use the default ones and ldap has its own. Make the functions pdb_getgr* return NTSTATUS instead of BOOL. Nobody right now really makes use of it, but it feels wrong to throw away information so early. Volker (This used to be commit f9856f6490fe44fdba97ea86062237d8c74d4bdc) --- source3/utils/net_groupmap.c | 12 ++++++------ source3/utils/net_rpc_samsync.c | 6 +++--- source3/utils/net_sam.c | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c index 3865382c92..10ea8cce2a 100644 --- a/source3/utils/net_groupmap.c +++ b/source3/utils/net_groupmap.c @@ -66,7 +66,7 @@ static BOOL get_sid_from_input(DOM_SID *sid, char *input) if (StrnCaseCmp( input, "S-", 2)) { /* Perhaps its the NT group name? */ - if (!pdb_getgrnam(&map, input)) { + if (!NT_STATUS_IS_OK(pdb_getgrnam(&map, input))) { printf("NT Group %s doesn't exist in mapping DB\n", input); return False; } else { @@ -153,7 +153,7 @@ static int net_groupmap_list(int argc, const char **argv) } /* Get the current mapping from the database */ - if(!pdb_getgrsid(&map, &sid)) { + if(!NT_STATUS_IS_OK(pdb_getgrsid(&map, &sid))) { d_fprintf(stderr, "Failure to local group SID in the database\n"); return -1; } @@ -265,7 +265,7 @@ static int net_groupmap_add(int argc, const char **argv) { GROUP_MAP map; - if (pdb_getgrgid(&map, gid)) { + if (NT_STATUS_IS_OK(pdb_getgrgid(&map, gid))) { d_printf("Unix group %s already mapped to SID %s\n", unixgrp, sid_string_static(&map.sid)); return -1; @@ -404,7 +404,7 @@ static int net_groupmap_modify(int argc, const char **argv) } /* Get the current mapping from the database */ - if(!pdb_getgrsid(&map, &sid)) { + if(!NT_STATUS_IS_OK(pdb_getgrsid(&map, &sid))) { d_fprintf(stderr, "Failure to local group SID in the database\n"); return -1; } @@ -533,13 +533,13 @@ static int net_groupmap_set(int argc, const char **argv) } } - have_map = pdb_getgrnam(&map, ntgroup); + have_map = NT_STATUS_IS_OK(pdb_getgrnam(&map, ntgroup)); if (!have_map) { DOM_SID sid; have_map = ( (strncmp(ntgroup, "S-", 2) == 0) && string_to_sid(&sid, ntgroup) && - pdb_getgrsid(&map, &sid) ); + NT_STATUS_IS_OK(pdb_getgrsid(&map, &sid)) ); } if (!have_map) { diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index fe3c919d9a..09c6f4c775 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -588,7 +588,7 @@ static NTSTATUS fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta) group_sid = *pdb_get_group_sid(sam_account); - if (!pdb_getgrsid(&map, &group_sid)) { + if (!NT_STATUS_IS_OK(pdb_getgrsid(&map, &group_sid))) { DEBUG(0, ("Primary group of %s has no mapping!\n", pdb_get_username(sam_account))); } else { @@ -630,7 +630,7 @@ static NTSTATUS fetch_group_info(uint32 rid, SAM_GROUP_INFO *delta) sid_append_rid(&group_sid, rid); sid_to_string(sid_string, &group_sid); - if (pdb_getgrsid(&map, &group_sid)) { + if (NT_STATUS_IS_OK(pdb_getgrsid(&map, &group_sid))) { if ( map.gid != -1 ) grp = getgrgid(map.gid); insert = False; @@ -815,7 +815,7 @@ static NTSTATUS fetch_alias_info(uint32 rid, SAM_ALIAS_INFO *delta, sid_copy(&alias_sid, &dom_sid); sid_append_rid(&alias_sid, rid); - if (pdb_getgrsid(&map, &alias_sid)) { + if (NT_STATUS_IS_OK(pdb_getgrsid(&map, &alias_sid))) { grp = getgrgid(map.gid); insert = False; } diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c index aed07553b6..16f7b1b25b 100644 --- a/source3/utils/net_sam.c +++ b/source3/utils/net_sam.c @@ -330,7 +330,7 @@ static int net_sam_set_comment(int argc, const char **argv) return -1; } - if (!pdb_getgrsid(&map, &sid)) { + if (!NT_STATUS_IS_OK(pdb_getgrsid(&map, &sid))) { d_fprintf(stderr, "Could not load group %s\n", argv[0]); return -1; } @@ -882,7 +882,7 @@ static int net_sam_provision(int argc, const char **argv) sid_compose(&gsid, get_global_sam_sid(), DOMAIN_GROUP_RID_USERS); - if (!pdb_getgrsid(&gmap, &gsid)) { + if (!NT_STATUS_IS_OK(pdb_getgrsid(&gmap, &gsid))) { LDAPMod **mods = NULL; char *dn; char *uname; @@ -935,7 +935,7 @@ domu_done: sid_compose(&gsid, get_global_sam_sid(), DOMAIN_GROUP_RID_ADMINS); - if (!pdb_getgrsid(&gmap, &gsid)) { + if (!NT_STATUS_IS_OK(pdb_getgrsid(&gmap, &gsid))) { LDAPMod **mods = NULL; char *dn; char *uname; @@ -1153,7 +1153,7 @@ doma_done: goto done; } - if (!pdb_getgrgid(&gmap, pwd->pw_gid)) { + if (!NT_STATUS_IS_OK(pdb_getgrgid(&gmap, pwd->pw_gid))) { LDAPMod **mods = NULL; char *dn; char *uname; -- cgit