]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
netlogon_creds_cli: add netlogon_creds_cli_SendToSam_recv() and don't ignore result
authorStefan Metzmacher <metze@samba.org>
Mon, 16 Apr 2018 14:08:29 +0000 (16:08 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 19 Oct 2021 20:20:00 +0000 (20:20 +0000)
This is a low level function that should not ignore results.

If the caller doesn't care it's his choice.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 19 20:20:00 UTC 2021 on sn-devel-184

libcli/auth/netlogon_creds_cli.c
libcli/auth/netlogon_creds_cli.h

index e78bc17396897c2b8983f99a93ff0d6c687ed36c..beab2fae53a01cd32a8f843efacc6487bf53ee9d 100644 (file)
@@ -3820,6 +3820,20 @@ static void netlogon_creds_cli_SendToSam_done(struct tevent_req *subreq)
        tevent_req_done(req);
 }
 
+NTSTATUS netlogon_creds_cli_SendToSam_recv(struct tevent_req *req)
+{
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               netlogon_creds_cli_SendToSam_cleanup(req, status);
+               tevent_req_received(req);
+               return status;
+       }
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
 NTSTATUS netlogon_creds_cli_SendToSam(struct netlogon_creds_cli_context *context,
                                      struct dcerpc_binding_handle *b,
                                      struct netr_SendToSamBase *message)
@@ -3827,7 +3841,7 @@ NTSTATUS netlogon_creds_cli_SendToSam(struct netlogon_creds_cli_context *context
        TALLOC_CTX *frame = talloc_stackframe();
        struct tevent_context *ev;
        struct tevent_req *req;
-       NTSTATUS status = NT_STATUS_OK;
+       NTSTATUS status = NT_STATUS_NO_MEMORY;
 
        ev = samba_tevent_context_init(frame);
        if (ev == NULL) {
@@ -3840,8 +3854,7 @@ NTSTATUS netlogon_creds_cli_SendToSam(struct netlogon_creds_cli_context *context
        if (!tevent_req_poll_ntstatus(req, ev, &status)) {
                goto fail;
        }
-
-       /* Ignore the result */
+       status = netlogon_creds_cli_SendToSam_recv(req);
  fail:
        TALLOC_FREE(frame);
        return status;
index 7fb41872c36cbd5bb70aca750a0c5911a1084a14..6f40a46aa0a69142f95046cc663d34abaa52f421 100644 (file)
@@ -208,7 +208,7 @@ struct tevent_req *netlogon_creds_cli_SendToSam_send(TALLOC_CTX *mem_ctx,
                                                     struct netlogon_creds_cli_context *context,
                                                     struct dcerpc_binding_handle *b,
                                                     struct netr_SendToSamBase *message);
-
+NTSTATUS netlogon_creds_cli_SendToSam_recv(struct tevent_req *req);
 NTSTATUS netlogon_creds_cli_SendToSam(
                                struct netlogon_creds_cli_context *context,
                                struct dcerpc_binding_handle *b,