]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Use pidl for _netr_NetrEnumerateTrustedDomains().
authorGünther Deschner <gd@samba.org>
Wed, 13 Feb 2008 09:23:45 +0000 (10:23 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 13 Feb 2008 09:23:45 +0000 (10:23 +0100)
This call is completely broken. For now, just make sure that we return the exact same
data as before the conversion to pidl.

Guenther

source/rpc_server/srv_netlog.c
source/rpc_server/srv_netlog_nt.c

index 30ef02bee8c899d90082d5c36c7a3046faab64c8..4f0a0142e5244226a937c5d27a9179489525a08d 100644 (file)
 #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);
 }
 
 /*************************************************************************
index 3a7075ecd6d1918b1e53fa528805e93d5372aded..528a33915aa437fbb0e8fa71572ba770cfb4a6c2 100644 (file)
@@ -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)
 {