/* Check the machine account password is valid */
+static void winbindd_check_machine_acct_recv(TALLOC_CTX *mem_ctx, bool success,
+ struct winbindd_ndr_call *c,
+ void *private_data,
+ void *_cont,
+ void *_cont_private)
+{
+ struct winbindd_cli_state *state =
+ talloc_get_type_abort(private_data, struct winbindd_cli_state);
+ struct winbind_trust *r =
+ talloc_get_type_abort(c->ndr.r, struct winbind_trust);
+
+ if (!success) {
+ DEBUG(5, ("Could not check machine acct\n"));
+ request_error(state);
+ return;
+ }
+
+ if (r->out.result != WINBIND_STATUS_OK) {
+ DEBUG(5, ("check machine acct returned an error:0x%08X\n",
+ r->out.result));
+ request_error(state);
+ return;
+ }
+
+ request_ok(state);
+}
+
void winbindd_check_machine_acct(struct winbindd_cli_state *state)
{
+ struct winbind_trust *r;
+
DEBUG(3, ("[%5lu]: check machine account\n",
(unsigned long)state->pid));
- sendto_domain(state, find_our_domain());
+ r = TALLOC_P(state->mem_ctx, struct winbind_trust);
+ if (!r) goto nomem;
+ r->in.level = TALLOC_P(r, enum winbind_trust_level);
+ if (!r->in.level) goto nomem;
+
+ *r->in.level = WINBIND_TRUST_LEVEL_COMPAT_CHECK_MACHCC;
+
+ do_async_ndr_domain(state->mem_ctx, find_our_domain(),
+ NDR_WINBIND_TRUST, r,
+ winbindd_check_machine_acct_recv, state,
+ NULL, NULL);
+ return;
+nomem:
+ DEBUG(0, ("talloc failed\n"));
+ request_error(state);
}
enum winbindd_result winbindd_dual_check_machine_acct(struct winbindd_domain *domain,