summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-08-27 02:31:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:02:49 -0500
commitb8da2d1ee512c00c4804d2db80d07d3442d9852f (patch)
tree7dbccf271fec31268c5929f8ffa43cb11f35c456 /source4
parent4b31fd4409cd9eca29469c09ce4b585c6d5f1a81 (diff)
downloadsamba-b8da2d1ee512c00c4804d2db80d07d3442d9852f.tar.gz
samba-b8da2d1ee512c00c4804d2db80d07d3442d9852f.tar.bz2
samba-b8da2d1ee512c00c4804d2db80d07d3442d9852f.zip
r24697: Excelent patch and detective work by Matthias Wallnöfer
<mwallnoefer@yahoo.de> noticing that: > The error was caused by info1 that is'nt talloced but rather static. In fact, no caller supplies info1 as a valid talloc context - other callers supply an element into the array. Andrew Bartlett (This used to be commit c8e6a87867909b092d0451cd619d7eff4cd80dff)
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/cracknames.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/dsdb/samdb/cracknames.c b/source4/dsdb/samdb/cracknames.c
index 810ba90107..aa5d221fd8 100644
--- a/source4/dsdb/samdb/cracknames.c
+++ b/source4/dsdb/samdb/cracknames.c
@@ -45,7 +45,7 @@ static WERROR DsCrackNameOneSyntactical(TALLOC_CTX *mem_ctx,
struct ldb_dn *name_dn, const char *name,
struct drsuapi_DsNameInfo1 *info1);
-static WERROR dns_domain_from_principal(struct smb_krb5_context *smb_krb5_context,
+static WERROR dns_domain_from_principal(TALLOC_CTX *mem_ctx, struct smb_krb5_context *smb_krb5_context,
const char *name,
struct drsuapi_DsNameInfo1 *info1)
{
@@ -63,7 +63,7 @@ static WERROR dns_domain_from_principal(struct smb_krb5_context *smb_krb5_contex
/* This isn't an allocation assignemnt, so it is free'ed with the krb5_free_principal */
realm = krb5_princ_realm(smb_krb5_context->krb5_context, principal);
- info1->dns_domain_name = talloc_strdup(info1, *realm);
+ info1->dns_domain_name = talloc_strdup(mem_ctx, *realm);
krb5_free_principal(smb_krb5_context->krb5_context, principal);
W_ERROR_HAVE_NO_MEMORY(info1->dns_domain_name);
@@ -298,7 +298,7 @@ static WERROR DsCrackNameUPN(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
case 1:
break;
case 0:
- return dns_domain_from_principal(smb_krb5_context,
+ return dns_domain_from_principal(mem_ctx, smb_krb5_context,
name, info1);
case -1:
DEBUG(2, ("DsCrackNameUPN domain ref search failed: %s", ldb_errstring(sam_ctx)));
@@ -560,7 +560,7 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
if (ret) {
krb5_free_principal(smb_krb5_context->krb5_context, principal);
- return dns_domain_from_principal(smb_krb5_context,
+ return dns_domain_from_principal(mem_ctx, smb_krb5_context,
name, info1);
}