summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-24 17:42:18 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-25 05:06:18 +0200
commitb05d28ebddb7ebd4f8e28a80489fceb8703a9868 (patch)
tree99b094692093c84f805e956a6433e0c8744d7305
parent646012954c4704375912ba2c049266f122c76f97 (diff)
downloadsamba-b05d28ebddb7ebd4f8e28a80489fceb8703a9868.tar.gz
samba-b05d28ebddb7ebd4f8e28a80489fceb8703a9868.tar.bz2
samba-b05d28ebddb7ebd4f8e28a80489fceb8703a9868.zip
s4:winbind: let wb_update_rodc_dns_send/recv use netlogon_queue (bug #9097)
metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sat Aug 25 05:06:18 CEST 2012 on sn-devel-104
-rw-r--r--source4/winbind/wb_update_rodc_dns.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/source4/winbind/wb_update_rodc_dns.c b/source4/winbind/wb_update_rodc_dns.c
index 7d4d1a8fae..bd29d7865c 100644
--- a/source4/winbind/wb_update_rodc_dns.c
+++ b/source4/winbind/wb_update_rodc_dns.c
@@ -42,6 +42,8 @@ struct wb_update_rodc_dns_state {
struct winbind_DsrUpdateReadOnlyServerDnsRecords *req;
+ struct wbsrv_domain *domain;
+ struct tevent_queue_entry *queue_entry;
struct netlogon_creds_CredentialState *creds_state;
struct netr_Authenticator auth1, auth2;
@@ -50,6 +52,7 @@ struct wb_update_rodc_dns_state {
};
static void wb_update_rodc_dns_recv_domain(struct composite_context *csubreq);
+static void wb_sam_logon_queue_trigger(struct tevent_req *req, void *priv);
static void wb_update_rodc_dns_recv_response(struct tevent_req *subreq);
/*
@@ -95,14 +98,33 @@ static void wb_update_rodc_dns_recv_domain(struct composite_context *csubreq)
tevent_req_data(req,
struct wb_update_rodc_dns_state);
NTSTATUS status;
- struct wbsrv_domain *domain;
- struct tevent_req *subreq;
+ struct tevent_queue_entry *e;
- status = wb_sid2domain_recv(csubreq, &domain);
+ status = wb_sid2domain_recv(csubreq, &state->domain);
if (tevent_req_nterror(req, status)) {
return;
}
+ /*
+ * Because of the netlogon_creds behavior we have to
+ * queue the netr_LogonSamLogon() calls
+ */
+ e = tevent_queue_add_entry(state->domain->netlogon_queue,
+ state->ev,
+ req,
+ wb_sam_logon_queue_trigger,
+ NULL);
+ state->queue_entry = e;
+}
+
+static void wb_sam_logon_queue_trigger(struct tevent_req *req, void *priv)
+{
+ struct wb_update_rodc_dns_state *state =
+ tevent_req_data(req,
+ struct wb_update_rodc_dns_state);
+ struct wbsrv_domain *domain = state->domain;
+ struct tevent_req *subreq;
+
state->creds_state = cli_credentials_get_netlogon_creds(domain->libnet_ctx->cred);
netlogon_creds_client_authenticator(state->creds_state, &state->auth1);
@@ -181,6 +203,11 @@ static void wb_update_rodc_dns_recv_response(struct tevent_req *subreq)
return;
}
+ /*
+ * we do not need the netlogon_creds lock anymore
+ */
+ TALLOC_FREE(state->queue_entry);
+
tevent_req_done(req);
}