]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli/auth: make use of netlogon_creds_cli_store_internal() in netlogon_creds_cli_au...
authorStefan Metzmacher <metze@samba.org>
Wed, 19 Jul 2023 15:43:00 +0000 (17:43 +0200)
committerJule Anger <janger@samba.org>
Wed, 13 Nov 2024 10:39:11 +0000 (10:39 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15425

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(cherry picked from commit 69cb9aea67de0613f467f7ce2d460364ff2be241)

libcli/auth/netlogon_creds_cli.c

index 118c81f6246b1ef6fe125097dea799172415b9bc..154906342b7bf18b060f80f2e72c056ed2be56eb 100644 (file)
@@ -1417,9 +1417,6 @@ static void netlogon_creds_cli_auth_srvauth_done(struct tevent_req *subreq)
        NTSTATUS status;
        NTSTATUS result;
        bool ok;
-       enum ndr_err_code ndr_err;
-       DATA_BLOB blob;
-       TDB_DATA data;
        bool downgraded;
 
        if (state->try_auth3) {
@@ -1518,20 +1515,8 @@ static void netlogon_creds_cli_auth_srvauth_done(struct tevent_req *subreq)
                return;
        }
 
-       ndr_err = ndr_push_struct_blob(&blob, state, state->creds,
-               (ndr_push_flags_fn_t)ndr_push_netlogon_creds_CredentialState);
-       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-               status = ndr_map_error2ntstatus(ndr_err);
-               tevent_req_nterror(req, status);
-               return;
-       }
-
-       data.dptr = blob.data;
-       data.dsize = blob.length;
-
-       status = dbwrap_store(state->context->db.ctx,
-                             state->context->db.key_data,
-                             data, TDB_REPLACE);
+       status = netlogon_creds_cli_store_internal(state->context,
+                                                  state->creds);
        if (tevent_req_nterror(req, status)) {
                return;
        }