[SCM] Samba Shared Repository - branch master updated
Andreas Schneider
asn at samba.org
Thu Mar 5 18:41:01 UTC 2020
The branch, master has been updated
via a4ed6ada500 Remove unnecessary/incorrect talloc_steal() calls
from 0dd2a27347b python: Fix userPrincipalName in GetPasswordCommand.get_account_attributes()
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit a4ed6ada500c3ee7ef8b5e43998968627121f255
Author: Jonathon Reinhart <Jonathon.Reinhart at gmail.com>
Date: Wed Feb 5 00:25:36 2020 -0500
Remove unnecessary/incorrect talloc_steal() calls
The talloc_steal() in dsdb_enum_group_mem() is unnecessary, because
members was already allocated from the same mem_ctx.
The talloc_steal() in pdb_samba_dsdb_enum_aliasmem() is also unnecessary
for the same reason, but also incorrect, because it should be
dereferencing pmembers:
talloc_steal(mem_ctx, *pmembers);
Furthermore, we should only assign to *pnum_members on success; otherwise
num_members is used uninitialized.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14264
Signed-off-by: Jonathon Reinhart <Jonathon.Reinhart at gmail.com>
Reviewed-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Thu Mar 5 18:40:16 UTC 2020 on sn-devel-184
-----------------------------------------------------------------------
Summary of changes:
source3/passdb/pdb_samba_dsdb.c | 3 +--
source4/dsdb/common/util_samr.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/passdb/pdb_samba_dsdb.c b/source3/passdb/pdb_samba_dsdb.c
index 351881722e6..c5f8d479fb6 100644
--- a/source3/passdb/pdb_samba_dsdb.c
+++ b/source3/passdb/pdb_samba_dsdb.c
@@ -1752,9 +1752,8 @@ static NTSTATUS pdb_samba_dsdb_enum_aliasmem(struct pdb_methods *m,
}
status = dsdb_enum_group_mem(state->ldb, mem_ctx, dn, pmembers, &num_members);
- *pnum_members = num_members;
if (NT_STATUS_IS_OK(status)) {
- talloc_steal(mem_ctx, pmembers);
+ *pnum_members = num_members;
}
talloc_free(tmp_ctx);
return status;
diff --git a/source4/dsdb/common/util_samr.c b/source4/dsdb/common/util_samr.c
index 5370fc94eba..89339c109d0 100644
--- a/source4/dsdb/common/util_samr.c
+++ b/source4/dsdb/common/util_samr.c
@@ -495,7 +495,7 @@ NTSTATUS dsdb_enum_group_mem(struct ldb_context *ldb,
++j;
}
- *members_out = talloc_steal(mem_ctx, members);
+ *members_out = members;
*pnum_members = j;
talloc_free(tmp_ctx);
return NT_STATUS_OK;
--
Samba Shared Repository
More information about the samba-cvs
mailing list