[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Fri Mar 26 14:43:53 MDT 2010
The branch, master has been updated
via e968db6... s3 ntlm_auth: Don't malloc data that will be talloc_free()d
from c1f6f61... tdb: update exports and signatures files
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit e968db67395cbfa1e0c46eb7c03b77916579596d
Author: Kai Blin <kai at samba.org>
Date: Thu Mar 25 22:22:56 2010 +0100
s3 ntlm_auth: Don't malloc data that will be talloc_free()d
This fixes bug #7290
Thanks to Mohan <mohann at silver-peak.com> for the bug report.
-----------------------------------------------------------------------
Summary of changes:
source3/utils/ntlm_auth.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c
index 049aa30..9bd7b5a 100644
--- a/source3/utils/ntlm_auth.c
+++ b/source3/utils/ntlm_auth.c
@@ -1165,18 +1165,18 @@ static void offer_gss_spnego_mechs(void) {
/* Server negTokenInit (mech offerings) */
spnego.type = SPNEGO_NEG_TOKEN_INIT;
- spnego.negTokenInit.mechTypes = SMB_XMALLOC_ARRAY(const char *, 2);
+ spnego.negTokenInit.mechTypes = talloc_array(ctx, const char *, 2);
#ifdef HAVE_KRB5
- spnego.negTokenInit.mechTypes[0] = smb_xstrdup(OID_KERBEROS5_OLD);
- spnego.negTokenInit.mechTypes[1] = smb_xstrdup(OID_NTLMSSP);
+ spnego.negTokenInit.mechTypes[0] = talloc_strdup(ctx, OID_KERBEROS5_OLD);
+ spnego.negTokenInit.mechTypes[1] = talloc_strdup(ctx, OID_NTLMSSP);
spnego.negTokenInit.mechTypes[2] = NULL;
#else
- spnego.negTokenInit.mechTypes[0] = smb_xstrdup(OID_NTLMSSP);
+ spnego.negTokenInit.mechTypes[0] = talloc_strdup(ctx, OID_NTLMSSP);
spnego.negTokenInit.mechTypes[1] = NULL;
#endif
- spnego.negTokenInit.mechListMIC = data_blob(principal,
+ spnego.negTokenInit.mechListMIC = data_blob_talloc(ctx, principal,
strlen(principal));
len = spnego_write_data(ctx, &token, &spnego);
@@ -1301,8 +1301,8 @@ static void manage_gss_spnego_request(struct ntlm_auth_state *state,
request.negTokenInit.mechToken.length);
response.type = SPNEGO_NEG_TOKEN_TARG;
- response.negTokenTarg.supportedMech = SMB_STRDUP(OID_NTLMSSP);
- response.negTokenTarg.mechListMIC = data_blob_null;
+ response.negTokenTarg.supportedMech = talloc_strdup(ctx, OID_NTLMSSP);
+ response.negTokenTarg.mechListMIC = data_blob_talloc(ctx, NULL, 0);
status = ntlmssp_update(ntlmssp_state,
request.negTokenInit.mechToken,
@@ -1326,9 +1326,9 @@ static void manage_gss_spnego_request(struct ntlm_auth_state *state,
}
response.type = SPNEGO_NEG_TOKEN_TARG;
- response.negTokenTarg.supportedMech = SMB_STRDUP(OID_KERBEROS5_OLD);
- response.negTokenTarg.mechListMIC = data_blob_null;
- response.negTokenTarg.responseToken = data_blob_null;
+ response.negTokenTarg.supportedMech = talloc_strdup(ctx, OID_KERBEROS5_OLD);
+ response.negTokenTarg.mechListMIC = data_blob_talloc(ctx, NULL, 0);
+ response.negTokenTarg.responseToken = data_blob_talloc(ctx, NULL, 0);
status = ads_verify_ticket(mem_ctx, lp_realm(), 0,
&request.negTokenInit.mechToken,
@@ -1387,8 +1387,8 @@ static void manage_gss_spnego_request(struct ntlm_auth_state *state,
&response.negTokenTarg.responseToken);
response.type = SPNEGO_NEG_TOKEN_TARG;
- response.negTokenTarg.supportedMech = SMB_STRDUP(OID_NTLMSSP);
- response.negTokenTarg.mechListMIC = data_blob_null;
+ response.negTokenTarg.supportedMech = talloc_strdup(ctx, OID_NTLMSSP);
+ response.negTokenTarg.mechListMIC = data_blob_talloc(ctx, NULL, 0);
if (NT_STATUS_IS_OK(status)) {
user = SMB_STRDUP(ntlmssp_state->user);
--
Samba Shared Repository
More information about the samba-cvs
mailing list