From: Stefan Metzmacher Date: Wed, 19 Jul 2023 15:43:00 +0000 (+0200) Subject: libcli/auth: make use of netlogon_creds_cli_store_internal() in netlogon_creds_cli_au... X-Git-Tag: ldb-2.9.2~63 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b3fd6d36e990c1be611e2c449d027c9b91981772;p=thirdparty%2Fsamba.git libcli/auth: make use of netlogon_creds_cli_store_internal() in netlogon_creds_cli_auth_srvauth_done() BUG: https://bugzilla.samba.org/show_bug.cgi?id=15425 Signed-off-by: Stefan Metzmacher Reviewed-by: Douglas Bagnall (cherry picked from commit 69cb9aea67de0613f467f7ce2d460364ff2be241) --- diff --git a/libcli/auth/netlogon_creds_cli.c b/libcli/auth/netlogon_creds_cli.c index 118c81f6246..154906342b7 100644 --- a/libcli/auth/netlogon_creds_cli.c +++ b/libcli/auth/netlogon_creds_cli.c @@ -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; }