s3: Use any_nt_status_not_ok in winbind
[abartlet/samba.git/.git] / source3 / winbindd / winbindd_check_machine_acct.c
index 33b6d9fba413dcf0b63819b65b150d6d350c5828..5f9cefa20920ea38d0347fbe8cbed1af50b78449 100644 (file)
@@ -61,8 +61,8 @@ struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       subreq = rpccli_wbint_CheckMachineAccount_send(state, ev,
-                                                      domain->child.rpccli);
+       subreq = dcerpc_wbint_CheckMachineAccount_send(state, ev,
+                                                      domain->child.binding_handle);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
@@ -78,20 +78,19 @@ static void winbindd_check_machine_acct_done(struct tevent_req *subreq)
                req, struct winbindd_check_machine_acct_state);
        NTSTATUS status, result;
 
-       status = rpccli_wbint_CheckMachineAccount_recv(subreq, state, &result);
-       if (!NT_STATUS_IS_OK(status)) {
+       status = dcerpc_wbint_CheckMachineAccount_recv(subreq, state, &result);
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
 NTSTATUS winbindd_check_machine_acct_recv(struct tevent_req *req,
                                          struct winbindd_response *presp)
 {
-       return tevent_req_simple_recv_ntstatus(req);
+       NTSTATUS status = tevent_req_simple_recv_ntstatus(req);
+
+       set_auth_errors(presp, status);
+       return status;
 }