[SCM] Samba Shared Repository - branch v3-2-test updated -
initial-v3-2-test-2048-g65c2aa3
Günther Deschner
gd at samba.org
Fri Feb 8 22:46:22 GMT 2008
The branch, v3-2-test has been updated
via 65c2aa344e45064cbfddd87715862d60f7ac2a8a (commit)
via 4f3e97cbae3df8e12db37b8a8a0eaee947fa723a (commit)
via f113c340c80f8ecbec37fa8e8c59c7e36777ca64 (commit)
via 51c629f902f5c949c3004f162055d03b18514765 (commit)
from 6cb59410c247c2e994150e051c7e065aa6521ac4 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 65c2aa344e45064cbfddd87715862d60f7ac2a8a
Author: Günther Deschner <gd at samba.org>
Date: Fri Feb 8 23:33:52 2008 +0100
Remove unused marshalling for NET_DSR_GETDCNAME.
Guenther
commit 4f3e97cbae3df8e12db37b8a8a0eaee947fa723a
Author: Günther Deschner <gd at samba.org>
Date: Fri Feb 8 23:28:02 2008 +0100
Use rpccli_netr_DsRGetDCName() in rpcclient and winbindd.
Guenther
commit f113c340c80f8ecbec37fa8e8c59c7e36777ca64
Author: Günther Deschner <gd at samba.org>
Date: Fri Feb 8 23:37:45 2008 +0100
Re-run make idl.
Guenther
commit 51c629f902f5c949c3004f162055d03b18514765
Author: Günther Deschner <gd at samba.org>
Date: Fri Feb 8 23:36:01 2008 +0100
Fix IDL for netr_DsRGetDCName.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source/include/rpc_netlogon.h | 33 -----
source/librpc/gen_ndr/cli_netlogon.c | 2 +-
source/librpc/gen_ndr/cli_netlogon.h | 2 +-
source/librpc/gen_ndr/ndr_netlogon.c | 27 ++++-
source/librpc/gen_ndr/netlogon.h | 2 +-
source/librpc/gen_ndr/srv_netlogon.c | 2 +-
source/librpc/idl/netlogon.idl | 2 +-
source/rpc_client/cli_netlogon.c | 136 -------------------
source/rpc_parse/parse_net.c | 236 ----------------------------------
source/rpcclient/cmd_netlogon.c | 26 +++--
source/winbindd/winbindd_cm.c | 25 ++--
11 files changed, 58 insertions(+), 435 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/include/rpc_netlogon.h b/source/include/rpc_netlogon.h
index 21dd42d..bab2caa 100644
--- a/source/include/rpc_netlogon.h
+++ b/source/include/rpc_netlogon.h
@@ -1029,37 +1029,4 @@ struct DS_DOMAIN_CONTROLLER_INFO {
const char *client_site_name;
};
-/* NET_Q_DSR_GETDCNAME */
-typedef struct net_q_dsr_getdcname {
- uint32 ptr_server_unc;
- UNISTR2 uni_server_unc;
- uint32 ptr_domain_name;
- UNISTR2 uni_domain_name;
- uint32 ptr_domain_guid;
- struct GUID *domain_guid;
- uint32 ptr_site_guid;
- struct GUID *site_guid;
- uint32 flags;
-} NET_Q_DSR_GETDCNAME;
-
-/* NET_R_DSR_GETDCNAME */
-typedef struct net_r_dsr_getdcname {
- uint32 ptr_dc_unc;
- UNISTR2 uni_dc_unc;
- uint32 ptr_dc_address;
- UNISTR2 uni_dc_address;
- int32 dc_address_type;
- struct GUID domain_guid;
- uint32 ptr_domain_name;
- UNISTR2 uni_domain_name;
- uint32 ptr_forest_name;
- UNISTR2 uni_forest_name;
- uint32 dc_flags;
- uint32 ptr_dc_site_name;
- UNISTR2 uni_dc_site_name;
- uint32 ptr_client_site_name;
- UNISTR2 uni_client_site_name;
- WERROR result;
-} NET_R_DSR_GETDCNAME;
-
#endif /* _RPC_NETLOGON_H */
diff --git a/source/librpc/gen_ndr/cli_netlogon.c b/source/librpc/gen_ndr/cli_netlogon.c
index cac3962..de04c21 100644
--- a/source/librpc/gen_ndr/cli_netlogon.c
+++ b/source/librpc/gen_ndr/cli_netlogon.c
@@ -1057,7 +1057,7 @@ NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli,
struct GUID *domain_guid,
struct GUID *site_guid,
uint32_t flags,
- struct netr_DsRGetDCNameInfo *info,
+ struct netr_DsRGetDCNameInfo **info,
WERROR *werror)
{
struct netr_DsRGetDCName r;
diff --git a/source/librpc/gen_ndr/cli_netlogon.h b/source/librpc/gen_ndr/cli_netlogon.h
index fa04323..4aa0f9f 100644
--- a/source/librpc/gen_ndr/cli_netlogon.h
+++ b/source/librpc/gen_ndr/cli_netlogon.h
@@ -178,7 +178,7 @@ NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli,
struct GUID *domain_guid,
struct GUID *site_guid,
uint32_t flags,
- struct netr_DsRGetDCNameInfo *info,
+ struct netr_DsRGetDCNameInfo **info,
WERROR *werror);
NTSTATUS rpccli_netr_NETRLOGONDUMMYROUTINE1(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
diff --git a/source/librpc/gen_ndr/ndr_netlogon.c b/source/librpc/gen_ndr/ndr_netlogon.c
index eabbc33..dd1d2cf 100644
--- a/source/librpc/gen_ndr/ndr_netlogon.c
+++ b/source/librpc/gen_ndr/ndr_netlogon.c
@@ -10983,7 +10983,10 @@ static enum ndr_err_code ndr_push_netr_DsRGetDCName(struct ndr_push *ndr, int fl
if (r->out.info == NULL) {
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
- NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info));
+ if (*r->out.info) {
+ NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
+ }
NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
}
return NDR_ERR_SUCCESS;
@@ -10995,11 +10998,13 @@ static enum ndr_err_code ndr_pull_netr_DsRGetDCName(struct ndr_pull *ndr, int fl
uint32_t _ptr_domain_name;
uint32_t _ptr_domain_guid;
uint32_t _ptr_site_guid;
+ uint32_t _ptr_info;
TALLOC_CTX *_mem_save_server_unc_0;
TALLOC_CTX *_mem_save_domain_name_0;
TALLOC_CTX *_mem_save_domain_guid_0;
TALLOC_CTX *_mem_save_site_guid_0;
TALLOC_CTX *_mem_save_info_0;
+ TALLOC_CTX *_mem_save_info_1;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
@@ -11073,7 +11078,18 @@ static enum ndr_err_code ndr_pull_netr_DsRGetDCName(struct ndr_pull *ndr, int fl
}
_mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
- NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
+ if (_ptr_info) {
+ NDR_PULL_ALLOC(ndr, *r->out.info);
+ } else {
+ *r->out.info = NULL;
+ }
+ if (*r->out.info) {
+ _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0);
+ NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
+ }
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
}
@@ -11122,7 +11138,12 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *nam
ndr->depth++;
ndr_print_ptr(ndr, "info", r->out.info);
ndr->depth++;
- ndr_print_netr_DsRGetDCNameInfo(ndr, "info", r->out.info);
+ ndr_print_ptr(ndr, "info", *r->out.info);
+ ndr->depth++;
+ if (*r->out.info) {
+ ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info);
+ }
+ ndr->depth--;
ndr->depth--;
ndr_print_WERROR(ndr, "result", r->out.result);
ndr->depth--;
diff --git a/source/librpc/gen_ndr/netlogon.h b/source/librpc/gen_ndr/netlogon.h
index 612e309..ef2218c 100644
--- a/source/librpc/gen_ndr/netlogon.h
+++ b/source/librpc/gen_ndr/netlogon.h
@@ -1181,7 +1181,7 @@ struct netr_DsRGetDCName {
} in;
struct {
- struct netr_DsRGetDCNameInfo *info;/* [ref] */
+ struct netr_DsRGetDCNameInfo **info;/* [ref] */
WERROR result;
} out;
diff --git a/source/librpc/gen_ndr/srv_netlogon.c b/source/librpc/gen_ndr/srv_netlogon.c
index b9e6ae6..673f950 100644
--- a/source/librpc/gen_ndr/srv_netlogon.c
+++ b/source/librpc/gen_ndr/srv_netlogon.c
@@ -1679,7 +1679,7 @@ static bool api_netr_DsRGetDCName(pipes_struct *p)
}
ZERO_STRUCT(r->out);
- r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo);
+ r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *);
if (r->out.info == NULL) {
talloc_free(r);
return false;
diff --git a/source/librpc/idl/netlogon.idl b/source/librpc/idl/netlogon.idl
index 5b84452..ae16884 100644
--- a/source/librpc/idl/netlogon.idl
+++ b/source/librpc/idl/netlogon.idl
@@ -982,7 +982,7 @@ interface netlogon
[in,unique] GUID *domain_guid,
[in,unique] GUID *site_guid,
[in] netr_DsRGetDCName_flags flags,
- [out,ref] netr_DsRGetDCNameInfo *info
+ [out,ref] netr_DsRGetDCNameInfo **info
);
/*****************/
diff --git a/source/rpc_client/cli_netlogon.c b/source/rpc_client/cli_netlogon.c
index 5a0c581..a6167bb 100644
--- a/source/rpc_client/cli_netlogon.c
+++ b/source/rpc_client/cli_netlogon.c
@@ -379,142 +379,6 @@ NTSTATUS rpccli_netlogon_logon_ctrl2(struct rpc_pipe_client *cli, TALLOC_CTX *me
return result;
}
-static WERROR pull_domain_controller_info_from_getdcname_reply(TALLOC_CTX *mem_ctx,
- struct DS_DOMAIN_CONTROLLER_INFO **info_out,
- NET_R_DSR_GETDCNAME *r)
-{
- struct DS_DOMAIN_CONTROLLER_INFO *info;
-
- info = TALLOC_ZERO_P(mem_ctx, struct DS_DOMAIN_CONTROLLER_INFO);
- if (!info) {
- return WERR_NOMEM;
- }
-
- if (&r->uni_dc_unc) {
-
- char *tmp;
- tmp = rpcstr_pull_unistr2_talloc(mem_ctx, &r->uni_dc_unc);
- if (tmp == NULL) {
- return WERR_GENERAL_FAILURE;
- }
- if (*tmp == '\\') tmp += 1;
- if (*tmp == '\\') tmp += 1;
-
- info->domain_controller_name = talloc_strdup(mem_ctx, tmp);
- if (info->domain_controller_name == NULL) {
- return WERR_GENERAL_FAILURE;
- }
- }
-
- if (&r->uni_dc_address) {
-
- char *tmp;
- tmp = rpcstr_pull_unistr2_talloc(mem_ctx, &r->uni_dc_address);
- if (tmp == NULL) {
- return WERR_GENERAL_FAILURE;
- }
- if (*tmp == '\\') tmp += 1;
- if (*tmp == '\\') tmp += 1;
-
- info->domain_controller_address = talloc_strdup(mem_ctx, tmp);
- if (info->domain_controller_address == NULL) {
- return WERR_GENERAL_FAILURE;
- }
- }
-
- info->domain_controller_address_type = r->dc_address_type;
-
- info->domain_guid = (struct GUID *)talloc_memdup(
- mem_ctx, &r->domain_guid, sizeof(struct GUID));
- if (!info->domain_guid) {
- return WERR_GENERAL_FAILURE;
- }
-
- if (&r->uni_domain_name) {
- info->domain_name = rpcstr_pull_unistr2_talloc(mem_ctx, &r->uni_domain_name);
- if (!info->domain_name) {
- return WERR_GENERAL_FAILURE;
- }
- }
-
- if (&r->uni_forest_name) {
- info->dns_forest_name = rpcstr_pull_unistr2_talloc(mem_ctx, &r->uni_forest_name);
- if (!info->dns_forest_name) {
- return WERR_GENERAL_FAILURE;
- }
- }
-
- info->flags = r->dc_flags;
-
- if (&r->uni_dc_site_name) {
- info->dc_site_name = rpcstr_pull_unistr2_talloc(mem_ctx, &r->uni_dc_site_name);
- if (!info->dc_site_name) {
- return WERR_GENERAL_FAILURE;
- }
- }
-
- if (&r->uni_client_site_name) {
- info->client_site_name = rpcstr_pull_unistr2_talloc(mem_ctx, &r->uni_client_site_name);
- if (!info->client_site_name) {
- return WERR_GENERAL_FAILURE;
- }
- }
-
- *info_out = info;
-
- return WERR_OK;
-}
-
-/* Dsr_GetDCName */
-
-WERROR rpccli_netlogon_dsr_getdcname(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx,
- const char *server_name,
- const char *domain_name,
- struct GUID *domain_guid,
- struct GUID *site_guid,
- uint32_t flags,
- struct DS_DOMAIN_CONTROLLER_INFO **info_out)
-{
- prs_struct qbuf, rbuf;
- NET_Q_DSR_GETDCNAME q;
- NET_R_DSR_GETDCNAME r;
- char *tmp_str;
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Initialize input parameters */
-
- tmp_str = talloc_asprintf(mem_ctx, "\\\\%s", server_name);
- if (tmp_str == NULL) {
- return WERR_NOMEM;
- }
-
- init_net_q_dsr_getdcname(&q, tmp_str, domain_name, domain_guid,
- site_guid, flags);
-
- /* Marshall data and send request */
-
- CLI_DO_RPC_WERR(cli, mem_ctx, PI_NETLOGON, NET_DSR_GETDCNAME,
- q, r,
- qbuf, rbuf,
- net_io_q_dsr_getdcname,
- net_io_r_dsr_getdcname,
- WERR_GENERAL_FAILURE);
-
- if (!W_ERROR_IS_OK(r.result)) {
- return r.result;
- }
-
- r.result = pull_domain_controller_info_from_getdcname_reply(mem_ctx, info_out, &r);
- if (!W_ERROR_IS_OK(r.result)) {
- return r.result;
- }
-
- return WERR_OK;
-}
-
/* Sam synchronisation */
NTSTATUS rpccli_netlogon_sam_sync(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
diff --git a/source/rpc_parse/parse_net.c b/source/rpc_parse/parse_net.c
index c68d930..55af821 100644
--- a/source/rpc_parse/parse_net.c
+++ b/source/rpc_parse/parse_net.c
@@ -3240,239 +3240,3 @@ bool net_io_r_sam_deltas(const char *desc,
return True;
}
-
-/*******************************************************************
- Inits a NET_Q_DSR_GETDCNAME structure.
-********************************************************************/
-
-void init_net_q_dsr_getdcname(NET_Q_DSR_GETDCNAME *r_t, const char *server_unc,
- const char *domain_name,
- struct GUID *domain_guid,
- struct GUID *site_guid,
- uint32_t flags)
-{
- DEBUG(5, ("init_net_q_dsr_getdcname\n"));
-
- r_t->ptr_server_unc = (server_unc != NULL);
- init_unistr2(&r_t->uni_server_unc, server_unc, UNI_STR_TERMINATE);
-
- r_t->ptr_domain_name = (domain_name != NULL);
- init_unistr2(&r_t->uni_domain_name, domain_name, UNI_STR_TERMINATE);
-
- r_t->ptr_domain_guid = (domain_guid != NULL);
- r_t->domain_guid = domain_guid;
-
- r_t->ptr_site_guid = (site_guid != NULL);
- r_t->site_guid = site_guid;
-
- r_t->flags = flags;
-}
-
-/*******************************************************************
- Reads or writes an NET_Q_DSR_GETDCNAME structure.
-********************************************************************/
-
-bool net_io_q_dsr_getdcname(const char *desc, NET_Q_DSR_GETDCNAME *r_t,
- prs_struct *ps, int depth)
-{
- if (r_t == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "net_io_q_dsr_getdcname");
- depth++;
-
- if (!prs_uint32("ptr_server_unc", ps, depth, &r_t->ptr_server_unc))
- return False;
-
- if (!smb_io_unistr2("server_unc", &r_t->uni_server_unc,
- r_t->ptr_server_unc, ps, depth))
- return False;
-
- if (!prs_align(ps))
- return False;
-
- if (!prs_uint32("ptr_domain_name", ps, depth, &r_t->ptr_domain_name))
- return False;
-
- if (!smb_io_unistr2("domain_name", &r_t->uni_domain_name,
- r_t->ptr_domain_name, ps, depth))
- return False;
-
- if (!prs_align(ps))
- return False;
-
- if (!prs_uint32("ptr_domain_guid", ps, depth, &r_t->ptr_domain_guid))
- return False;
-
- if (UNMARSHALLING(ps) && (r_t->ptr_domain_guid)) {
- r_t->domain_guid = PRS_ALLOC_MEM(ps, struct GUID, 1);
- if (r_t->domain_guid == NULL)
- return False;
- }
-
- if ((r_t->ptr_domain_guid) &&
- (!smb_io_uuid("domain_guid", r_t->domain_guid, ps, depth)))
- return False;
-
- if (!prs_align(ps))
- return False;
-
- if (!prs_uint32("ptr_site_guid", ps, depth, &r_t->ptr_site_guid))
- return False;
-
- if (UNMARSHALLING(ps) && (r_t->ptr_site_guid)) {
- r_t->site_guid = PRS_ALLOC_MEM(ps, struct GUID, 1);
- if (r_t->site_guid == NULL)
- return False;
- }
-
- if ((r_t->ptr_site_guid) &&
- (!smb_io_uuid("site_guid", r_t->site_guid, ps, depth)))
- return False;
-
- if (!prs_align(ps))
- return False;
-
- if (!prs_uint32("flags", ps, depth, &r_t->flags))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- Inits a NET_R_DSR_GETDCNAME structure.
-********************************************************************/
-void init_net_r_dsr_getdcname(NET_R_DSR_GETDCNAME *r_t, const char *dc_unc,
- const char *dc_address, int32 dc_address_type,
- struct GUID domain_guid, const char *domain_name,
- const char *forest_name, uint32 dc_flags,
- const char *dc_site_name,
- const char *client_site_name)
-{
- DEBUG(5, ("init_net_q_dsr_getdcname\n"));
-
- r_t->ptr_dc_unc = (dc_unc != NULL);
- init_unistr2(&r_t->uni_dc_unc, dc_unc, UNI_STR_TERMINATE);
-
- r_t->ptr_dc_address = (dc_address != NULL);
- init_unistr2(&r_t->uni_dc_address, dc_address, UNI_STR_TERMINATE);
-
- r_t->dc_address_type = dc_address_type;
- r_t->domain_guid = domain_guid;
-
- r_t->ptr_domain_name = (domain_name != NULL);
- init_unistr2(&r_t->uni_domain_name, domain_name, UNI_STR_TERMINATE);
-
- r_t->ptr_forest_name = (forest_name != NULL);
- init_unistr2(&r_t->uni_forest_name, forest_name, UNI_STR_TERMINATE);
-
- r_t->dc_flags = dc_flags;
-
- r_t->ptr_dc_site_name = (dc_site_name != NULL);
- init_unistr2(&r_t->uni_dc_site_name, dc_site_name, UNI_STR_TERMINATE);
-
- r_t->ptr_client_site_name = (client_site_name != NULL);
- init_unistr2(&r_t->uni_client_site_name, client_site_name,
- UNI_STR_TERMINATE);
-}
-
-/*******************************************************************
- Reads or writes an NET_R_DSR_GETDCNAME structure.
-********************************************************************/
-
-bool net_io_r_dsr_getdcname(const char *desc, NET_R_DSR_GETDCNAME *r_t,
- prs_struct *ps, int depth)
-{
- uint32 info_ptr = 1;
-
- if (r_t == NULL)
- return False;
-
- prs_debug(ps, depth, desc, "net_io_r_dsr_getdcname");
- depth++;
-
- /* The reply contains *just* an info struct, this is the ptr to it */
- if (!prs_uint32("info_ptr", ps, depth, &info_ptr))
- return False;
-
- if (info_ptr == 0)
- return False;
-
- if (!prs_uint32("ptr_dc_unc", ps, depth, &r_t->ptr_dc_unc))
- return False;
-
- if (!prs_uint32("ptr_dc_address", ps, depth, &r_t->ptr_dc_address))
- return False;
-
- if (!prs_int32("dc_address_type", ps, depth, &r_t->dc_address_type))
- return False;
-
- if (!smb_io_uuid("domain_guid", &r_t->domain_guid, ps, depth))
- return False;
-
- if (!prs_uint32("ptr_domain_name", ps, depth, &r_t->ptr_domain_name))
- return False;
-
- if (!prs_uint32("ptr_forest_name", ps, depth, &r_t->ptr_forest_name))
--
Samba Shared Repository
More information about the samba-cvs
mailing list