summaryrefslogtreecommitdiffstats
path: root/source/utils/ntlm_auth.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-07 18:25:53 +0000
committerJeremy Allison <jra@samba.org>2004-12-07 18:25:53 +0000
commit65b7a21d331b7f0cfbc6bd6545adde00ce2826fa (patch)
treefcd3f6d39e40486c4042636106a700b4c263de25 /source/utils/ntlm_auth.c
parenta411fc03345bf9b152536f0d33b460d5c89c2b30 (diff)
downloadsamba-65b7a21d331b7f0cfbc6bd6545adde00ce2826fa.tar.gz
samba-65b7a21d331b7f0cfbc6bd6545adde00ce2826fa.tar.xz
samba-65b7a21d331b7f0cfbc6bd6545adde00ce2826fa.zip
r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy.
Diffstat (limited to 'source/utils/ntlm_auth.c')
-rw-r--r--source/utils/ntlm_auth.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/source/utils/ntlm_auth.c b/source/utils/ntlm_auth.c
index 3d515238316..3d55c373558 100644
--- a/source/utils/ntlm_auth.c
+++ b/source/utils/ntlm_auth.c
@@ -238,7 +238,7 @@ static BOOL get_require_membership_sid(void) {
return False;
}
- require_membership_of_sid = strdup(response.data.sid.sid);
+ require_membership_of_sid = SMB_STRDUP(response.data.sid.sid);
if (require_membership_of_sid)
return True;
@@ -378,7 +378,7 @@ NTSTATUS contact_winbind_auth_crap(const char *username,
}
if (flags & WBFLAG_PAM_UNIX_NAME) {
- *unix_name = strdup((char *)response.extra_data);
+ *unix_name = SMB_STRDUP((char *)response.extra_data);
if (!*unix_name) {
free_response(&response);
return NT_STATUS_NO_MEMORY;
@@ -552,7 +552,7 @@ static void manage_squid_ntlmssp_request(enum stdio_helper_mode stdio_helper_mod
if ((strncmp(buf, "PW ", 3) == 0)) {
/* The calling application wants us to use a local password (rather than winbindd) */
- opt_password = strndup((const char *)request.data, request.length);
+ opt_password = SMB_STRNDUP((const char *)request.data, request.length);
if (opt_password == NULL) {
DEBUG(1, ("Out of memory\n"));
@@ -634,7 +634,7 @@ static void manage_client_ntlmssp_request(enum stdio_helper_mode stdio_helper_mo
if (strncmp(buf, "PW ", 3) == 0) {
/* We asked for a password and obviously got it :-) */
- opt_password = strndup((const char *)request.data, request.length);
+ opt_password = SMB_STRNDUP((const char *)request.data, request.length);
if (opt_password == NULL) {
DEBUG(1, ("Out of memory\n"));
@@ -753,7 +753,7 @@ static void offer_gss_spnego_mechs(void) {
/* Server negTokenInit (mech offerings) */
spnego.type = SPNEGO_NEG_TOKEN_INIT;
- spnego.negTokenInit.mechTypes = smb_xmalloc(sizeof(char *) * 3);
+ spnego.negTokenInit.mechTypes = SMB_XMALLOC_ARRAY(char *, 3);
#ifdef HAVE_KRB5
spnego.negTokenInit.mechTypes[0] = smb_xstrdup(OID_KERBEROS5_OLD);
spnego.negTokenInit.mechTypes[1] = smb_xstrdup(OID_NTLMSSP);
@@ -883,7 +883,7 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
request.negTokenInit.mechToken.length);
response.type = SPNEGO_NEG_TOKEN_TARG;
- response.negTokenTarg.supportedMech = strdup(OID_NTLMSSP);
+ response.negTokenTarg.supportedMech = SMB_STRDUP(OID_NTLMSSP);
response.negTokenTarg.mechListMIC = data_blob(NULL, 0);
status = ntlmssp_update(ntlmssp_state,
@@ -906,7 +906,7 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
}
response.type = SPNEGO_NEG_TOKEN_TARG;
- response.negTokenTarg.supportedMech = strdup(OID_KERBEROS5_OLD);
+ response.negTokenTarg.supportedMech = SMB_STRDUP(OID_KERBEROS5_OLD);
response.negTokenTarg.mechListMIC = data_blob(NULL, 0);
response.negTokenTarg.responseToken = data_blob(NULL, 0);
@@ -930,8 +930,8 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
}
*domain++ = '\0';
- domain = strdup(domain);
- user = strdup(principal);
+ domain = SMB_STRDUP(domain);
+ user = SMB_STRDUP(principal);
data_blob_free(&ap_rep);
data_blob_free(&auth_data);
@@ -964,12 +964,12 @@ static void manage_gss_spnego_request(enum stdio_helper_mode stdio_helper_mode,
&response.negTokenTarg.responseToken);
response.type = SPNEGO_NEG_TOKEN_TARG;
- response.negTokenTarg.supportedMech = strdup(OID_NTLMSSP);
+ response.negTokenTarg.supportedMech = SMB_STRDUP(OID_NTLMSSP);
response.negTokenTarg.mechListMIC = data_blob(NULL, 0);
if (NT_STATUS_IS_OK(status)) {
- user = strdup(ntlmssp_state->user);
- domain = strdup(ntlmssp_state->domain);
+ user = SMB_STRDUP(ntlmssp_state->user);
+ domain = SMB_STRDUP(ntlmssp_state->domain);
ntlmssp_end(&ntlmssp_state);
}
}
@@ -1155,7 +1155,7 @@ static BOOL manage_client_krb5_init(SPNEGO_DATA spnego)
return False;
}
- principal = malloc(spnego.negTokenInit.mechListMIC.length+1);
+ principal = SMB_MALLOC(spnego.negTokenInit.mechListMIC.length+1);
if (principal == NULL) {
DEBUG(1, ("Could not malloc principal\n"));
@@ -1266,7 +1266,7 @@ static void manage_gss_spnego_client_request(enum stdio_helper_mode stdio_helper
/* We asked for a password and obviously got it :-) */
- opt_password = strndup((const char *)request.data, request.length);
+ opt_password = SMB_STRNDUP((const char *)request.data, request.length);
if (opt_password == NULL) {
DEBUG(1, ("Out of memory\n"));