From: Noel Power Date: Fri, 20 Oct 2023 11:10:37 +0000 (+0100) Subject: s3/winbindd: use parse_domain_user instead of parse_domain_user_fstr X-Git-Tag: talloc-2.4.2~1164 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5427ef86bb1912ef5509141342e1a5c5ab074d7;p=thirdparty%2Fsamba.git s3/winbindd: use parse_domain_user instead of parse_domain_user_fstr In winbindd_ccache_ntlm_auth replace use of parse_domain_user_fstr with parse_domain_user Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider --- diff --git a/source3/winbindd/winbindd_ccache_access.c b/source3/winbindd/winbindd_ccache_access.c index 3bd3cb36b2f..cc395ad3bda 100644 --- a/source3/winbindd/winbindd_ccache_access.c +++ b/source3/winbindd/winbindd_ccache_access.c @@ -184,7 +184,6 @@ static bool check_client_uid(struct winbindd_cli_state *state, uid_t uid) bool winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state) { struct winbindd_domain *domain; - fstring f_name_namespace, f_name_domain, f_name_user; char *name_namespace = NULL; char *name_domain = NULL; char *name_user = NULL; @@ -253,10 +252,11 @@ bool winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state) TALLOC_FREE(name_domain); TALLOC_FREE(name_user); /* Parse domain and username */ - ok = parse_domain_user_fstr(state->request->data.ccache_ntlm_auth.user, - f_name_namespace, - f_name_domain, - f_name_user); + ok = parse_domain_user(state, + state->request->data.ccache_ntlm_auth.user, + &name_namespace, + &name_domain, + &name_user); if (!ok) { DEBUG(10,("winbindd_dual_ccache_ntlm_auth: cannot parse " "domain and user from name [%s]\n", @@ -264,24 +264,6 @@ bool winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state) goto process_result; } - name_namespace = talloc_strdup(state, f_name_namespace); - if (name_namespace == NULL) { - result = NT_STATUS_NO_MEMORY; - goto process_result; - } - - name_domain = talloc_strdup(state, f_name_domain); - if (name_domain == NULL) { - result = NT_STATUS_NO_MEMORY; - goto process_result; - } - - name_user = talloc_strdup(state, f_name_user); - if (name_user == NULL) { - result = NT_STATUS_NO_MEMORY; - goto process_result; - } - entry = find_memory_creds_by_name(state->request->data.ccache_ntlm_auth.user); if (entry == NULL || entry->nt_hash == NULL || entry->lm_hash == NULL) { DEBUG(10,("winbindd_dual_ccache_ntlm_auth: could not find " @@ -337,6 +319,9 @@ bool winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state) data_blob_free(&auth); process_result: + TALLOC_FREE(name_namespace); + TALLOC_FREE(name_domain); + TALLOC_FREE(name_user); return NT_STATUS_IS_OK(result); }