]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/winbindd: use parse_domain_user instead of parse_domain_user_fstr
authorNoel Power <noel.power@suse.com>
Fri, 20 Oct 2023 11:10:37 +0000 (12:10 +0100)
committerNoel Power <npower@samba.org>
Tue, 24 Oct 2023 12:43:37 +0000 (12:43 +0000)
In winbindd_ccache_ntlm_auth replace use of parse_domain_user_fstr
with parse_domain_user

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/winbindd/winbindd_ccache_access.c

index 3bd3cb36b2f009b081c3a1d84a601ac01c0d15e5..cc395ad3bda535cfc4932cc4e71c002f7c9a3a00 100644 (file)
@@ -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);
 }