[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-1290-ga95955f

Volker Lendecke vlendec at samba.org
Sat Aug 29 11:44:14 MDT 2009


The branch, master has been updated
       via  a95955f285ea13a3feddafa75edf8d2031d39403 (commit)
       via  129562206a17a6debf3a21a82381fdcf470c8665 (commit)
       via  e47491e83c27c5cd8dbc10e69b57f54ff570f703 (commit)
       via  e71714830e23032bef9e5f644ca9531e8bc168b6 (commit)
       via  9b5ad55de11d479f9127861f0ef485d7c9972312 (commit)
       via  8b9085472dc6a3e8d0dc84e3cbad0ba057fcec83 (commit)
       via  10e9df2975f9630a9fc9474fc810107bc7680f0f (commit)
       via  2555c12bcefa212d482c9acaa5ae87b6107fa1a2 (commit)
       via  50d9fb42fc771e07326f3f47103676f2ef88107e (commit)
       via  425239caeeb22cb0a221a38b70f2f2dc8b64bdcc (commit)
       via  15312e7310b63fbb22db319f201a8ce4f667ea62 (commit)
       via  244bb7f163017f409935e265370a4068b3bc8d0c (commit)
       via  7579f0fb175d9e9484465d54cbc933283c26005e (commit)
       via  9c30a8dc6fffd592592a108f3d9d93769ba74417 (commit)
       via  6e2bf7e23480cb467288adac145ec2853aeaa11d (commit)
       via  91588e6e8f01eee824f7a07d85247ac5a6cd8f9c (commit)
       via  c325ba89cfeb9c4bbf1733d15e063809f4bc1332 (commit)
       via  9ef2c7096341f849bd1b52bf92e01936c3869eee (commit)
       via  ae6a6690d5ed55935c1fa0ad2800d83455c94382 (commit)
      from  99cf696150a1b8e24a9d87981b710b703045a2a5 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit a95955f285ea13a3feddafa75edf8d2031d39403
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Aug 29 19:39:35 2009 +0200

    s3:nsstest: Fix a very confusing behaviour in nsstest
    
    Testing getgrent I thought I get the offset calculations wrong whereas
    it was only nsstest printing stuff with spaces...

commit 129562206a17a6debf3a21a82381fdcf470c8665
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Aug 29 19:28:42 2009 +0200

    s3:winbind: add a fake NDR winbind cache validator

commit e47491e83c27c5cd8dbc10e69b57f54ff570f703
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Aug 27 23:33:45 2009 +0200

    s3:winbind: Convert the getgrent functions to the new API

commit e71714830e23032bef9e5f644ca9531e8bc168b6
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Aug 29 15:21:29 2009 +0200

    s3:winbind: Add a comment about fill_grent_mem_domusers...

commit 9b5ad55de11d479f9127861f0ef485d7c9972312
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Aug 27 23:27:37 2009 +0200

    s3:winbind: Add some missing error checks

commit 8b9085472dc6a3e8d0dc84e3cbad0ba057fcec83
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Aug 27 21:54:58 2009 +0200

    s3:winbind: Fix a typo

commit 10e9df2975f9630a9fc9474fc810107bc7680f0f
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Aug 27 21:53:15 2009 +0200

    s3:winbind: Add async wb_next_grent

commit 2555c12bcefa212d482c9acaa5ae87b6107fa1a2
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Aug 27 19:54:18 2009 +0200

    s3:winbind: Add async QueryGroupList

commit 50d9fb42fc771e07326f3f47103676f2ef88107e
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Aug 27 17:11:24 2009 +0200

    w3:winbind: Convert WINBINDD_LOOKUPRIDS to the new API

commit 425239caeeb22cb0a221a38b70f2f2dc8b64bdcc
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Aug 26 12:27:32 2009 +0200

    s3:winbind: Convert the GETDCNAME routines to the new API

commit 15312e7310b63fbb22db319f201a8ce4f667ea62
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Aug 26 11:33:16 2009 +0200

    s3:winbind: Add async wb_dsgetdcname

commit 244bb7f163017f409935e265370a4068b3bc8d0c
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 25 23:02:44 2009 +0200

    s3:winbind: Convert winbindd_dsgetdcname to the new API

commit 7579f0fb175d9e9484465d54cbc933283c26005e
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 25 22:13:34 2009 +0200

    s3:winbind: Add an async dsgetdcname call

commit 9c30a8dc6fffd592592a108f3d9d93769ba74417
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Aug 17 23:13:48 2009 +0200

    s3:winbind: Convert the GETPWENT routines to the new API

commit 6e2bf7e23480cb467288adac145ec2853aeaa11d
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Aug 17 22:50:39 2009 +0200

    s3:winbind: Add async next_pwent

commit 91588e6e8f01eee824f7a07d85247ac5a6cd8f9c
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Aug 17 22:44:55 2009 +0200

    s3:winbind: Add async fill_pwent

commit c325ba89cfeb9c4bbf1733d15e063809f4bc1332
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Aug 17 22:40:19 2009 +0200

    s3:winbind: Add async query_user_list

commit 9ef2c7096341f849bd1b52bf92e01936c3869eee
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 25 12:38:47 2009 +0200

    s3:winbind: simplify wb_seqnums_done a bit

commit ae6a6690d5ed55935c1fa0ad2800d83455c94382
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 25 12:29:25 2009 +0200

    s3:winbind: Make wb_seqnums.c update the winbind cache seqnums

-----------------------------------------------------------------------

Summary of changes:
 source3/Makefile.in                     |   14 +
 source3/librpc/gen_ndr/cli_wbint.c      |  649 +++++++++++++++++++
 source3/librpc/gen_ndr/cli_wbint.h      |   50 ++
 source3/librpc/gen_ndr/ndr_wbint.c      |  465 ++++++++++++++-
 source3/librpc/gen_ndr/ndr_wbint.h      |   17 +-
 source3/librpc/gen_ndr/srv_wbint.c      |  372 +++++++++++
 source3/librpc/gen_ndr/srv_wbint.h      |    8 +
 source3/librpc/gen_ndr/wbint.h          |   52 ++
 source3/librpc/idl/wbint.idl            |   26 +
 source3/torture/nsstest.c               |    4 +-
 source3/winbindd/wb_dsgetdcname.c       |  115 ++++
 source3/winbindd/wb_fill_pwent.c        |  155 +++++
 source3/winbindd/wb_group_members.c     |    4 +
 source3/winbindd/wb_next_grent.c        |  177 ++++++
 source3/winbindd/wb_next_pwent.c        |  150 +++++
 source3/winbindd/wb_query_user_list.c   |   92 +++
 source3/winbindd/wb_seqnums.c           |   34 +-
 source3/winbindd/winbindd.c             |   40 +-
 source3/winbindd/winbindd.h             |   18 +-
 source3/winbindd/winbindd_async.c       |   58 --
 source3/winbindd/winbindd_cache.c       |   11 +
 source3/winbindd/winbindd_domain.c      |    4 -
 source3/winbindd/winbindd_dsgetdcname.c |  198 ++++++
 source3/winbindd/winbindd_dual_srv.c    |  174 ++++++
 source3/winbindd/winbindd_endgrent.c    |   49 ++
 source3/winbindd/winbindd_endpwent.c    |   49 ++
 source3/winbindd/winbindd_getdcname.c   |   88 +++
 source3/winbindd/winbindd_getgrent.c    |  203 ++++++
 source3/winbindd/winbindd_getgrgid.c    |    3 +
 source3/winbindd/winbindd_getgrnam.c    |    3 +
 source3/winbindd/winbindd_getpwent.c    |  145 +++++
 source3/winbindd/winbindd_group.c       | 1031 -------------------------------
 source3/winbindd/winbindd_locator.c     |  116 ----
 source3/winbindd/winbindd_lookuprids.c  |  197 ++++++
 source3/winbindd/winbindd_misc.c        |   20 -
 source3/winbindd/winbindd_proto.h       |  100 +++-
 source3/winbindd/winbindd_setgrent.c    |   55 ++
 source3/winbindd/winbindd_setpwent.c    |   55 ++
 source3/winbindd/winbindd_sid.c         |   30 -
 source3/winbindd/winbindd_user.c        |  376 -----------
 40 files changed, 3734 insertions(+), 1673 deletions(-)
 create mode 100644 source3/winbindd/wb_dsgetdcname.c
 create mode 100644 source3/winbindd/wb_fill_pwent.c
 create mode 100644 source3/winbindd/wb_next_grent.c
 create mode 100644 source3/winbindd/wb_next_pwent.c
 create mode 100644 source3/winbindd/wb_query_user_list.c
 create mode 100644 source3/winbindd/winbindd_dsgetdcname.c
 create mode 100644 source3/winbindd/winbindd_endgrent.c
 create mode 100644 source3/winbindd/winbindd_endpwent.c
 create mode 100644 source3/winbindd/winbindd_getdcname.c
 create mode 100644 source3/winbindd/winbindd_getgrent.c
 create mode 100644 source3/winbindd/winbindd_getpwent.c
 create mode 100644 source3/winbindd/winbindd_lookuprids.c
 create mode 100644 source3/winbindd/winbindd_setgrent.c
 create mode 100644 source3/winbindd/winbindd_setpwent.c


Changeset truncated at 500 lines:

diff --git a/source3/Makefile.in b/source3/Makefile.in
index b183cfd..55baff2 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1179,6 +1179,11 @@ WINBINDD_OBJ1 = \
 		winbindd/wb_seqnums.o \
 		winbindd/wb_group_members.o \
 		winbindd/wb_getgrsid.o \
+		winbindd/wb_query_user_list.o \
+		winbindd/wb_fill_pwent.o \
+		winbindd/wb_next_pwent.o \
+		winbindd/wb_next_grent.o \
+		winbindd/wb_dsgetdcname.o \
 		winbindd/winbindd_lookupsid.o \
 		winbindd/winbindd_lookupname.o \
 		winbindd/winbindd_sid_to_uid.o \
@@ -1195,6 +1200,15 @@ WINBINDD_OBJ1 = \
 		winbindd/winbindd_getgrgid.o \
 		winbindd/winbindd_getgrnam.o \
 		winbindd/winbindd_getusersids.o \
+		winbindd/winbindd_lookuprids.o \
+		winbindd/winbindd_setpwent.o \
+		winbindd/winbindd_getpwent.o \
+		winbindd/winbindd_endpwent.o \
+		winbindd/winbindd_setgrent.o \
+		winbindd/winbindd_getgrent.o \
+		winbindd/winbindd_endgrent.o \
+		winbindd/winbindd_dsgetdcname.o \
+		winbindd/winbindd_getdcname.o \
 		auth/token_util.o \
 		../nsswitch/libwbclient/wb_reqtrans.o \
 		smbd/connection.o
diff --git a/source3/librpc/gen_ndr/cli_wbint.c b/source3/librpc/gen_ndr/cli_wbint.c
index 06e0bf7..3b683a7 100644
--- a/source3/librpc/gen_ndr/cli_wbint.c
+++ b/source3/librpc/gen_ndr/cli_wbint.c
@@ -1966,3 +1966,652 @@ NTSTATUS rpccli_wbint_LookupGroupMembers(struct rpc_pipe_client *cli,
 	/* Return result */
 	return r.out.result;
 }
+
+struct rpccli_wbint_QueryUserList_state {
+	struct wbint_QueryUserList orig;
+	struct wbint_QueryUserList tmp;
+	TALLOC_CTX *out_mem_ctx;
+	NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wbint_QueryUserList_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wbint_QueryUserList_send(TALLOC_CTX *mem_ctx,
+						   struct tevent_context *ev,
+						   struct rpc_pipe_client *cli,
+						   struct wbint_userinfos *_users /* [out] [ref] */)
+{
+	struct tevent_req *req;
+	struct rpccli_wbint_QueryUserList_state *state;
+	struct tevent_req *subreq;
+
+	req = tevent_req_create(mem_ctx, &state,
+				struct rpccli_wbint_QueryUserList_state);
+	if (req == NULL) {
+		return NULL;
+	}
+	state->out_mem_ctx = NULL;
+	state->dispatch_recv = cli->dispatch_recv;
+
+	/* In parameters */
+
+	/* Out parameters */
+	state->orig.out.users = _users;
+
+	/* Result */
+	ZERO_STRUCT(state->orig.out.result);
+
+	if (DEBUGLEVEL >= 10) {
+		NDR_PRINT_IN_DEBUG(wbint_QueryUserList, &state->orig);
+	}
+
+	state->out_mem_ctx = talloc_named_const(state, 0,
+			     "rpccli_wbint_QueryUserList_out_memory");
+	if (tevent_req_nomem(state->out_mem_ctx, req)) {
+		return tevent_req_post(req, ev);
+	}
+
+	/* make a temporary copy, that we pass to the dispatch function */
+	state->tmp = state->orig;
+
+	subreq = cli->dispatch_send(state, ev, cli,
+				    &ndr_table_wbint,
+				    NDR_WBINT_QUERYUSERLIST,
+				    &state->tmp);
+	if (tevent_req_nomem(subreq, req)) {
+		return tevent_req_post(req, ev);
+	}
+	tevent_req_set_callback(subreq, rpccli_wbint_QueryUserList_done, req);
+	return req;
+}
+
+static void rpccli_wbint_QueryUserList_done(struct tevent_req *subreq)
+{
+	struct tevent_req *req = tevent_req_callback_data(
+		subreq, struct tevent_req);
+	struct rpccli_wbint_QueryUserList_state *state = tevent_req_data(
+		req, struct rpccli_wbint_QueryUserList_state);
+	NTSTATUS status;
+	TALLOC_CTX *mem_ctx;
+
+	if (state->out_mem_ctx) {
+		mem_ctx = state->out_mem_ctx;
+	} else {
+		mem_ctx = state;
+	}
+
+	status = state->dispatch_recv(subreq, mem_ctx);
+	TALLOC_FREE(subreq);
+	if (!NT_STATUS_IS_OK(status)) {
+		tevent_req_nterror(req, status);
+		return;
+	}
+
+	/* Copy out parameters */
+	*state->orig.out.users = *state->tmp.out.users;
+
+	/* Copy result */
+	state->orig.out.result = state->tmp.out.result;
+
+	/* Reset temporary structure */
+	ZERO_STRUCT(state->tmp);
+
+	if (DEBUGLEVEL >= 10) {
+		NDR_PRINT_OUT_DEBUG(wbint_QueryUserList, &state->orig);
+	}
+
+	tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wbint_QueryUserList_recv(struct tevent_req *req,
+					 TALLOC_CTX *mem_ctx,
+					 NTSTATUS *result)
+{
+	struct rpccli_wbint_QueryUserList_state *state = tevent_req_data(
+		req, struct rpccli_wbint_QueryUserList_state);
+	NTSTATUS status;
+
+	if (tevent_req_is_nterror(req, &status)) {
+		tevent_req_received(req);
+		return status;
+	}
+
+	/* Steal possbile out parameters to the callers context */
+	talloc_steal(mem_ctx, state->out_mem_ctx);
+
+	/* Return result */
+	*result = state->orig.out.result;
+
+	tevent_req_received(req);
+	return NT_STATUS_OK;
+}
+
+NTSTATUS rpccli_wbint_QueryUserList(struct rpc_pipe_client *cli,
+				    TALLOC_CTX *mem_ctx,
+				    struct wbint_userinfos *users /* [out] [ref] */)
+{
+	struct wbint_QueryUserList r;
+	NTSTATUS status;
+
+	/* In parameters */
+
+	if (DEBUGLEVEL >= 10) {
+		NDR_PRINT_IN_DEBUG(wbint_QueryUserList, &r);
+	}
+
+	status = cli->dispatch(cli,
+				mem_ctx,
+				&ndr_table_wbint,
+				NDR_WBINT_QUERYUSERLIST,
+				&r);
+
+	if (!NT_STATUS_IS_OK(status)) {
+		return status;
+	}
+
+	if (DEBUGLEVEL >= 10) {
+		NDR_PRINT_OUT_DEBUG(wbint_QueryUserList, &r);
+	}
+
+	if (NT_STATUS_IS_ERR(status)) {
+		return status;
+	}
+
+	/* Return variables */
+	*users = *r.out.users;
+
+	/* Return result */
+	return r.out.result;
+}
+
+struct rpccli_wbint_QueryGroupList_state {
+	struct wbint_QueryGroupList orig;
+	struct wbint_QueryGroupList tmp;
+	TALLOC_CTX *out_mem_ctx;
+	NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wbint_QueryGroupList_send(TALLOC_CTX *mem_ctx,
+						    struct tevent_context *ev,
+						    struct rpc_pipe_client *cli,
+						    struct wbint_Principals *_groups /* [out] [ref] */)
+{
+	struct tevent_req *req;
+	struct rpccli_wbint_QueryGroupList_state *state;
+	struct tevent_req *subreq;
+
+	req = tevent_req_create(mem_ctx, &state,
+				struct rpccli_wbint_QueryGroupList_state);
+	if (req == NULL) {
+		return NULL;
+	}
+	state->out_mem_ctx = NULL;
+	state->dispatch_recv = cli->dispatch_recv;
+
+	/* In parameters */
+
+	/* Out parameters */
+	state->orig.out.groups = _groups;
+
+	/* Result */
+	ZERO_STRUCT(state->orig.out.result);
+
+	if (DEBUGLEVEL >= 10) {
+		NDR_PRINT_IN_DEBUG(wbint_QueryGroupList, &state->orig);
+	}
+
+	state->out_mem_ctx = talloc_named_const(state, 0,
+			     "rpccli_wbint_QueryGroupList_out_memory");
+	if (tevent_req_nomem(state->out_mem_ctx, req)) {
+		return tevent_req_post(req, ev);
+	}
+
+	/* make a temporary copy, that we pass to the dispatch function */
+	state->tmp = state->orig;
+
+	subreq = cli->dispatch_send(state, ev, cli,
+				    &ndr_table_wbint,
+				    NDR_WBINT_QUERYGROUPLIST,
+				    &state->tmp);
+	if (tevent_req_nomem(subreq, req)) {
+		return tevent_req_post(req, ev);
+	}
+	tevent_req_set_callback(subreq, rpccli_wbint_QueryGroupList_done, req);
+	return req;
+}
+
+static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq)
+{
+	struct tevent_req *req = tevent_req_callback_data(
+		subreq, struct tevent_req);
+	struct rpccli_wbint_QueryGroupList_state *state = tevent_req_data(
+		req, struct rpccli_wbint_QueryGroupList_state);
+	NTSTATUS status;
+	TALLOC_CTX *mem_ctx;
+
+	if (state->out_mem_ctx) {
+		mem_ctx = state->out_mem_ctx;
+	} else {
+		mem_ctx = state;
+	}
+
+	status = state->dispatch_recv(subreq, mem_ctx);
+	TALLOC_FREE(subreq);
+	if (!NT_STATUS_IS_OK(status)) {
+		tevent_req_nterror(req, status);
+		return;
+	}
+
+	/* Copy out parameters */
+	*state->orig.out.groups = *state->tmp.out.groups;
+
+	/* Copy result */
+	state->orig.out.result = state->tmp.out.result;
+
+	/* Reset temporary structure */
+	ZERO_STRUCT(state->tmp);
+
+	if (DEBUGLEVEL >= 10) {
+		NDR_PRINT_OUT_DEBUG(wbint_QueryGroupList, &state->orig);
+	}
+
+	tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wbint_QueryGroupList_recv(struct tevent_req *req,
+					  TALLOC_CTX *mem_ctx,
+					  NTSTATUS *result)
+{
+	struct rpccli_wbint_QueryGroupList_state *state = tevent_req_data(
+		req, struct rpccli_wbint_QueryGroupList_state);
+	NTSTATUS status;
+
+	if (tevent_req_is_nterror(req, &status)) {
+		tevent_req_received(req);
+		return status;
+	}
+
+	/* Steal possbile out parameters to the callers context */
+	talloc_steal(mem_ctx, state->out_mem_ctx);
+
+	/* Return result */
+	*result = state->orig.out.result;
+
+	tevent_req_received(req);
+	return NT_STATUS_OK;
+}
+
+NTSTATUS rpccli_wbint_QueryGroupList(struct rpc_pipe_client *cli,
+				     TALLOC_CTX *mem_ctx,
+				     struct wbint_Principals *groups /* [out] [ref] */)
+{
+	struct wbint_QueryGroupList r;
+	NTSTATUS status;
+
+	/* In parameters */
+
+	if (DEBUGLEVEL >= 10) {
+		NDR_PRINT_IN_DEBUG(wbint_QueryGroupList, &r);
+	}
+
+	status = cli->dispatch(cli,
+				mem_ctx,
+				&ndr_table_wbint,
+				NDR_WBINT_QUERYGROUPLIST,
+				&r);
+
+	if (!NT_STATUS_IS_OK(status)) {
+		return status;
+	}
+
+	if (DEBUGLEVEL >= 10) {
+		NDR_PRINT_OUT_DEBUG(wbint_QueryGroupList, &r);
+	}
+
+	if (NT_STATUS_IS_ERR(status)) {
+		return status;
+	}
+
+	/* Return variables */
+	*groups = *r.out.groups;
+
+	/* Return result */
+	return r.out.result;
+}
+
+struct rpccli_wbint_DsGetDcName_state {
+	struct wbint_DsGetDcName orig;
+	struct wbint_DsGetDcName tmp;
+	TALLOC_CTX *out_mem_ctx;
+	NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+};
+
+static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq);
+
+struct tevent_req *rpccli_wbint_DsGetDcName_send(TALLOC_CTX *mem_ctx,
+						 struct tevent_context *ev,
+						 struct rpc_pipe_client *cli,
+						 const char *_domain_name /* [in] [ref,charset(UTF8)] */,
+						 struct GUID *_domain_guid /* [in] [unique] */,
+						 const char *_site_name /* [in] [unique,charset(UTF8)] */,
+						 uint32_t _flags /* [in]  */,
+						 struct netr_DsRGetDCNameInfo **_dc_info /* [out] [ref] */)
+{
+	struct tevent_req *req;
+	struct rpccli_wbint_DsGetDcName_state *state;
+	struct tevent_req *subreq;
+
+	req = tevent_req_create(mem_ctx, &state,
+				struct rpccli_wbint_DsGetDcName_state);
+	if (req == NULL) {
+		return NULL;
+	}
+	state->out_mem_ctx = NULL;
+	state->dispatch_recv = cli->dispatch_recv;
+
+	/* In parameters */
+	state->orig.in.domain_name = _domain_name;
+	state->orig.in.domain_guid = _domain_guid;
+	state->orig.in.site_name = _site_name;
+	state->orig.in.flags = _flags;
+
+	/* Out parameters */
+	state->orig.out.dc_info = _dc_info;
+
+	/* Result */
+	ZERO_STRUCT(state->orig.out.result);
+
+	if (DEBUGLEVEL >= 10) {
+		NDR_PRINT_IN_DEBUG(wbint_DsGetDcName, &state->orig);
+	}
+
+	state->out_mem_ctx = talloc_named_const(state, 0,
+			     "rpccli_wbint_DsGetDcName_out_memory");
+	if (tevent_req_nomem(state->out_mem_ctx, req)) {
+		return tevent_req_post(req, ev);
+	}
+
+	/* make a temporary copy, that we pass to the dispatch function */
+	state->tmp = state->orig;
+
+	subreq = cli->dispatch_send(state, ev, cli,
+				    &ndr_table_wbint,
+				    NDR_WBINT_DSGETDCNAME,
+				    &state->tmp);
+	if (tevent_req_nomem(subreq, req)) {
+		return tevent_req_post(req, ev);
+	}
+	tevent_req_set_callback(subreq, rpccli_wbint_DsGetDcName_done, req);
+	return req;
+}
+
+static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq)
+{
+	struct tevent_req *req = tevent_req_callback_data(
+		subreq, struct tevent_req);
+	struct rpccli_wbint_DsGetDcName_state *state = tevent_req_data(
+		req, struct rpccli_wbint_DsGetDcName_state);
+	NTSTATUS status;
+	TALLOC_CTX *mem_ctx;
+
+	if (state->out_mem_ctx) {
+		mem_ctx = state->out_mem_ctx;
+	} else {
+		mem_ctx = state;
+	}
+
+	status = state->dispatch_recv(subreq, mem_ctx);
+	TALLOC_FREE(subreq);
+	if (!NT_STATUS_IS_OK(status)) {
+		tevent_req_nterror(req, status);
+		return;
+	}
+
+	/* Copy out parameters */
+	*state->orig.out.dc_info = *state->tmp.out.dc_info;
+
+	/* Copy result */
+	state->orig.out.result = state->tmp.out.result;
+
+	/* Reset temporary structure */
+	ZERO_STRUCT(state->tmp);
+
+	if (DEBUGLEVEL >= 10) {
+		NDR_PRINT_OUT_DEBUG(wbint_DsGetDcName, &state->orig);
+	}
+
+	tevent_req_done(req);
+}
+
+NTSTATUS rpccli_wbint_DsGetDcName_recv(struct tevent_req *req,
+				       TALLOC_CTX *mem_ctx,
+				       NTSTATUS *result)
+{
+	struct rpccli_wbint_DsGetDcName_state *state = tevent_req_data(
+		req, struct rpccli_wbint_DsGetDcName_state);
+	NTSTATUS status;
+
+	if (tevent_req_is_nterror(req, &status)) {
+		tevent_req_received(req);
+		return status;
+	}
+
+	/* Steal possbile out parameters to the callers context */
+	talloc_steal(mem_ctx, state->out_mem_ctx);
+
+	/* Return result */
+	*result = state->orig.out.result;
+
+	tevent_req_received(req);
+	return NT_STATUS_OK;
+}
+
+NTSTATUS rpccli_wbint_DsGetDcName(struct rpc_pipe_client *cli,
+				  TALLOC_CTX *mem_ctx,
+				  const char *domain_name /* [in] [ref,charset(UTF8)] */,
+				  struct GUID *domain_guid /* [in] [unique] */,
+				  const char *site_name /* [in] [unique,charset(UTF8)] */,
+				  uint32_t flags /* [in]  */,
+				  struct netr_DsRGetDCNameInfo **dc_info /* [out] [ref] */)
+{
+	struct wbint_DsGetDcName r;
+	NTSTATUS status;
+
+	/* In parameters */
+	r.in.domain_name = domain_name;
+	r.in.domain_guid = domain_guid;
+	r.in.site_name = site_name;
+	r.in.flags = flags;
+
+	if (DEBUGLEVEL >= 10) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list