summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/srv_netlog.c46
-rw-r--r--source3/rpc_server/srv_netlog_nt.c32
2 files changed, 36 insertions, 42 deletions
diff --git a/source3/rpc_server/srv_netlog.c b/source3/rpc_server/srv_netlog.c
index 30ef02bee8..4f0a0142e5 100644
--- a/source3/rpc_server/srv_netlog.c
+++ b/source3/rpc_server/srv_netlog.c
@@ -28,6 +28,27 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV
+/*******************************************************************
+ ********************************************************************/
+
+static bool proxy_netr_call(pipes_struct *p, uint8 opnum)
+{
+ struct api_struct *fns;
+ int n_fns;
+
+ netlogon_get_pipe_fns(&fns, &n_fns);
+
+ if (opnum >= n_fns) {
+ return false;
+ }
+
+ if (fns[opnum].opnum != opnum) {
+ smb_panic("NETLOGON function table not sorted");
+ }
+
+ return fns[opnum].fn(p);
+}
+
/*************************************************************************
api_net_req_chal:
*************************************************************************/
@@ -218,30 +239,7 @@ static bool api_net_sam_logon(pipes_struct *p)
static bool api_net_trust_dom_list(pipes_struct *p)
{
- NET_Q_TRUST_DOM_LIST q_u;
- NET_R_TRUST_DOM_LIST r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- /* grab the lsa trusted domain list query... */
- if(!net_io_q_trust_dom("", &q_u, data, 0)) {
- DEBUG(0,("api_net_trust_dom_list: Failed to unmarshall NET_Q_TRUST_DOM_LIST.\n"));
- return False;
- }
-
- /* construct reply. */
- r_u.status = _net_trust_dom_list(p, &q_u, &r_u);
-
- /* store the response in the SMB stream */
- if(!net_io_r_trust_dom("", &r_u, rdata, 0)) {
- DEBUG(0,("net_reply_trust_dom_list: Failed to marshall NET_R_TRUST_DOM_LIST.\n"));
- return False;
- }
-
- return True;
+ return proxy_netr_call(p, NDR_NETR_NETRENUMERATETRUSTEDDOMAINS);
}
/*************************************************************************
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index 3a7075ecd6..528a33915a 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -145,22 +145,28 @@ NTSTATUS _net_logon_ctrl2(pipes_struct *p, NET_Q_LOGON_CTRL2 *q_u, NET_R_LOGON_C
}
/*************************************************************************
- net_reply_trust_dom_list:
+ _netr_NetrEnumerateTrustedDomains
*************************************************************************/
-NTSTATUS _net_trust_dom_list(pipes_struct *p, NET_Q_TRUST_DOM_LIST *q_u, NET_R_TRUST_DOM_LIST *r_u)
+WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p,
+ struct netr_NetrEnumerateTrustedDomains *r)
{
- const char *trusted_domain = "test_domain";
- uint32 num_trust_domains = 1;
+ struct netr_Blob trusted_domains_blob;
+ DATA_BLOB blob;
- DEBUG(6,("_net_trust_dom_list: %d\n", __LINE__));
+ DEBUG(6,("_netr_NetrEnumerateTrustedDomains: %d\n", __LINE__));
/* set up the Trusted Domain List response */
- init_r_trust_dom(r_u, num_trust_domains, trusted_domain);
- DEBUG(6,("_net_trust_dom_list: %d\n", __LINE__));
+ blob = data_blob_talloc_zero(p->mem_ctx, 2);
+ trusted_domains_blob.data = blob.data;
+ trusted_domains_blob.length = blob.length;
- return r_u->status;
+ DEBUG(6,("_netr_NetrEnumerateTrustedDomains: %d\n", __LINE__));
+
+ *r->out.trusted_domains_blob = trusted_domains_blob;
+
+ return WERR_OK;
}
/***********************************************************************************
@@ -1331,16 +1337,6 @@ WERROR _netr_LogonControl2Ex(pipes_struct *p,
/****************************************************************
****************************************************************/
-WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p,
- struct netr_NetrEnumerateTrustedDomains *r)
-{
- p->rng_fault_state = true;
- return WERR_NOT_SUPPORTED;
-}
-
-/****************************************************************
-****************************************************************/
-
WERROR _netr_DsRGetDCName(pipes_struct *p,
struct netr_DsRGetDCName *r)
{