[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Sun Apr 25 04:32:28 MDT 2010
The branch, master has been updated
via fd3eeb3... s3: async_domain_request is no longer used
via d53e345... s3: Convert add_trusted_domains() to wb_domain_request_send()
from d41836f... s3: Simplify trustdom_state
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit fd3eeb3878c94bfb8d2134dbdc17cfb5279d088c
Author: Volker Lendecke <vl at samba.org>
Date: Sun Apr 25 11:42:44 2010 +0200
s3: async_domain_request is no longer used
commit d53e3450c775a4eae9f5237ec85ed212479fbcbd
Author: Volker Lendecke <vl at samba.org>
Date: Sun Apr 25 11:40:30 2010 +0200
s3: Convert add_trusted_domains() to wb_domain_request_send()
-----------------------------------------------------------------------
Summary of changes:
source3/winbindd/winbindd_dual.c | 61 -------------------------------------
source3/winbindd/winbindd_proto.h | 6 ----
source3/winbindd/winbindd_util.c | 41 +++++++++++-------------
3 files changed, 19 insertions(+), 89 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index 073749e..4f314cf 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -367,67 +367,6 @@ int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
return 0;
}
-struct domain_request_state {
- struct winbindd_domain *domain;
- struct winbindd_request *request;
- struct winbindd_response *response;
- void (*continuation)(void *private_data_data, bool success);
- void *private_data_data;
-};
-
-static void async_domain_request_done(struct tevent_req *req);
-
-void async_domain_request(TALLOC_CTX *mem_ctx,
- struct winbindd_domain *domain,
- struct winbindd_request *request,
- struct winbindd_response *response,
- void (*continuation)(void *private_data_data, bool success),
- void *private_data_data)
-{
- struct tevent_req *subreq;
- struct domain_request_state *state;
-
- state = TALLOC_P(mem_ctx, struct domain_request_state);
- if (state == NULL) {
- DEBUG(0, ("talloc failed\n"));
- continuation(private_data_data, False);
- return;
- }
-
- state->domain = domain;
- state->request = request;
- state->response = response;
- state->continuation = continuation;
- state->private_data_data = private_data_data;
-
- subreq = wb_domain_request_send(state, winbind_event_context(),
- domain, request);
- if (subreq == NULL) {
- DEBUG(5, ("wb_domain_request_send failed\n"));
- continuation(private_data_data, false);
- return;
- }
- tevent_req_set_callback(subreq, async_domain_request_done, state);
-}
-
-static void async_domain_request_done(struct tevent_req *req)
-{
- struct domain_request_state *state = tevent_req_callback_data(
- req, struct domain_request_state);
- struct winbindd_response *response;
- int ret, err;
-
- ret = wb_domain_request_recv(req, state, &response, &err);
- TALLOC_FREE(req);
- if (ret == -1) {
- DEBUG(5, ("wb_domain_request returned %s\n", strerror(err)));
- state->continuation(state->private_data_data, false);
- return;
- }
- *(state->response) = *response;
- state->continuation(state->private_data_data, true);
-}
-
static void child_process_request(struct winbindd_child *child,
struct winbindd_cli_state *state)
{
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
index 981b2f6..fa1d5f2 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -270,12 +270,6 @@ struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
struct winbindd_response **presponse, int *err);
-void async_domain_request(TALLOC_CTX *mem_ctx,
- struct winbindd_domain *domain,
- struct winbindd_request *request,
- struct winbindd_response *response,
- void (*continuation)(void *private_data_data, bool success),
- void *private_data_data);
void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
const struct winbindd_child_dispatch_table *table,
const char *logprefix,
diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
index 83cc36b..eb471e8 100644
--- a/source3/winbindd/winbindd_util.c
+++ b/source3/winbindd/winbindd_util.c
@@ -238,51 +238,48 @@ bool domain_is_forest_root(const struct winbindd_domain *domain)
struct trustdom_state {
struct winbindd_domain *domain;
- struct winbindd_response *response;
+ struct winbindd_request request;
};
-static void trustdom_recv(void *private_data, bool success);
+static void trustdom_list_done(struct tevent_req *req);
static void rescan_forest_root_trusts( void );
static void rescan_forest_trusts( void );
static void add_trusted_domains( struct winbindd_domain *domain )
{
- struct winbindd_request *request;
- struct winbindd_response *response;
struct trustdom_state *state;
+ struct tevent_req *req;
state = TALLOC_ZERO_P(NULL, struct trustdom_state);
if (state == NULL) {
- DEBUG(0, ("talloc_init failed\n"));
+ DEBUG(0, ("talloc failed\n"));
return;
}
+ state->domain = domain;
- request = TALLOC_ZERO_P(state, struct winbindd_request);
- response = TALLOC_P(state, struct winbindd_response);
+ state->request.length = sizeof(state->request);
+ state->request.cmd = WINBINDD_LIST_TRUSTDOM;
- if ((request == NULL) || (response == NULL)) {
- DEBUG(0, ("talloc failed\n"));
+ req = wb_domain_request_send(state, winbind_event_context(),
+ domain, &state->request);
+ if (req == NULL) {
+ DEBUG(1, ("wb_domain_request_send failed\n"));
TALLOC_FREE(state);
return;
}
- state->response = response;
- state->domain = domain;
-
- request->length = sizeof(*request);
- request->cmd = WINBINDD_LIST_TRUSTDOM;
-
- async_domain_request(state, domain, request, response,
- trustdom_recv, state);
+ tevent_req_set_callback(req, trustdom_list_done, state);
}
-static void trustdom_recv(void *private_data, bool success)
+static void trustdom_list_done(struct tevent_req *req)
{
- struct trustdom_state *state =
- talloc_get_type_abort(private_data, struct trustdom_state);
- struct winbindd_response *response = state->response;
+ struct trustdom_state *state = tevent_req_callback_data(
+ req, struct trustdom_state);
+ struct winbindd_response *response;
+ int res, err;
char *p;
- if ((!success) || (response->result != WINBINDD_OK)) {
+ res = wb_domain_request_recv(req, state, &response, &err);
+ if ((res == -1) || (response->result != WINBINDD_OK)) {
DEBUG(1, ("Could not receive trustdoms\n"));
TALLOC_FREE(state);
return;
--
Samba Shared Repository
More information about the samba-cvs
mailing list