summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2019-03-21 10:54:49 +0100
committerJule Anger <janger@samba.org>2023-03-30 15:10:10 +0000
commita19fe9301999a0ce308f06643ff3be1bbac7beb7 (patch)
tree864d8d8f5e97418bf68461063a1419c04857ca9c
parent5a754810dead1225554b5a9c5c5265079ae5c0a9 (diff)
downloadsamba-a19fe9301999a0ce308f06643ff3be1bbac7beb7.tar.gz
idmap_hash: we don't need to call idmap_hash_initialize() over an over again
It's always the first function that's called from idmap_methods. This also demonstrates that we currently always return NT_STATUS_OK, even if we haven't mapped all map entries. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15319 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 0da13ab3ad7278eafdcd988f39e891242eb46d37)
-rw-r--r--source3/winbindd/idmap_hash/idmap_hash.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/source3/winbindd/idmap_hash/idmap_hash.c b/source3/winbindd/idmap_hash/idmap_hash.c
index ce324bfd240..7b849aa0259 100644
--- a/source3/winbindd/idmap_hash/idmap_hash.c
+++ b/source3/winbindd/idmap_hash/idmap_hash.c
@@ -131,14 +131,6 @@ static NTSTATUS idmap_hash_initialize(struct idmap_domain *dom)
return NT_STATUS_INVALID_PARAMETER;
}
- /* If the domain SID hash table has been initialized, assume
- that we completed this function previously */
-
- if (dom->private_data != NULL) {
- nt_status = NT_STATUS_OK;
- goto done;
- }
-
if (!wcache_tdc_fetch_list(&dom_list, &num_domains)) {
nt_status = NT_STATUS_TRUSTED_DOMAIN_FAILURE;
BAIL_ON_NTSTATUS_ERROR(nt_status);
@@ -196,7 +188,6 @@ static NTSTATUS unixids_to_sids(struct idmap_domain *dom,
{
struct sid_hash_table *hashed_domains = talloc_get_type_abort(
dom->private_data, struct sid_hash_table);
- NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
int i;
/* initialize the status to avoid suprise */
@@ -204,9 +195,6 @@ static NTSTATUS unixids_to_sids(struct idmap_domain *dom,
ids[i]->status = ID_UNKNOWN;
}
- nt_status = idmap_hash_initialize(dom);
- BAIL_ON_NTSTATUS_ERROR(nt_status);
-
for (i=0; ids[i]; i++) {
uint32_t h_domain, h_rid;
@@ -225,8 +213,7 @@ static NTSTATUS unixids_to_sids(struct idmap_domain *dom,
ids[i]->status = ID_MAPPED;
}
-done:
- return nt_status;
+ return NT_STATUS_OK;
}
/*********************************************************************
@@ -235,7 +222,6 @@ done:
static NTSTATUS sids_to_unixids(struct idmap_domain *dom,
struct id_map **ids)
{
- NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
int i;
/* initialize the status to avoid suprise */
@@ -243,9 +229,6 @@ static NTSTATUS sids_to_unixids(struct idmap_domain *dom,
ids[i]->status = ID_UNKNOWN;
}
- nt_status = idmap_hash_initialize(dom);
- BAIL_ON_NTSTATUS_ERROR(nt_status);
-
for (i=0; ids[i]; i++) {
struct dom_sid sid;
uint32_t rid;
@@ -302,8 +285,7 @@ static NTSTATUS sids_to_unixids(struct idmap_domain *dom,
}
}
-done:
- return nt_status;
+ return NT_STATUS_OK;
}
/*********************************************************************