From 3b3e21bd9ba701a97e752205263a7903619541c7 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 19 Mar 2009 12:20:11 +1100 Subject: Convert Samba3 to use the common lib/util/charset API This removes calls to push_*_allocate() and pull_*_allocate(), as well as convert_string_allocate, as they are not in the common API To allow transition to a common charcnv in future, provide Samba4-like strupper functions in source3/lib/charcnv.c (the actual implementation remains distinct, but the API is now shared) Andrew Bartlett --- source3/utils/ntlm_auth_diagnostics.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'source3/utils/ntlm_auth_diagnostics.c') diff --git a/source3/utils/ntlm_auth_diagnostics.c b/source3/utils/ntlm_auth_diagnostics.c index dcdc8e9a40..17801b2a80 100644 --- a/source3/utils/ntlm_auth_diagnostics.c +++ b/source3/utils/ntlm_auth_diagnostics.c @@ -458,31 +458,31 @@ static bool test_plaintext(enum ntlm_break break_which) flags |= WBFLAG_PAM_LMKEY; flags |= WBFLAG_PAM_USER_SESSION_KEY; - if (!push_ucs2_allocate(&nt_response_ucs2, opt_password, + if (!push_ucs2_talloc(NULL, &nt_response_ucs2, opt_password, &converted_size)) { - DEBUG(0, ("push_ucs2_allocate failed!\n")); + DEBUG(0, ("push_ucs2_talloc failed!\n")); exit(1); } nt_response.data = (unsigned char *)nt_response_ucs2; nt_response.length = strlen_w(nt_response_ucs2)*sizeof(smb_ucs2_t); - if ((password = strdup_upper(opt_password)) == NULL) { - DEBUG(0, ("strdup_upper failed!\n")); + if ((password = strupper_talloc(NULL, opt_password)) == NULL) { + DEBUG(0, ("strupper_talloc() failed!\n")); exit(1); } - if (!convert_string_allocate(NULL, CH_UNIX, - CH_DOS, password, - strlen(password)+1, - &lm_response.data, - &lm_response.length, True)) { - DEBUG(0, ("convert_string_allocate failed!\n")); + if (!convert_string_talloc(NULL, CH_UNIX, + CH_DOS, password, + strlen(password)+1, + &lm_response.data, + &lm_response.length, True)) { + DEBUG(0, ("convert_string_talloc failed!\n")); exit(1); } - SAFE_FREE(password); + TALLOC_FREE(password); switch (break_which) { case BREAK_NONE: @@ -513,8 +513,8 @@ static bool test_plaintext(enum ntlm_break break_which) user_session_key, &error_string, NULL); - SAFE_FREE(nt_response.data); - SAFE_FREE(lm_response.data); + TALLOC_FREE(nt_response.data); + TALLOC_FREE(lm_response.data); data_blob_free(&chall); if (!NT_STATUS_IS_OK(nt_status)) { -- cgit