* fix some compile warnings in the gums code
authorGerald Carter <jerry@samba.org>
Fri, 17 Oct 2003 16:27:26 +0000 (16:27 +0000)
committerGerald Carter <jerry@samba.org>
Fri, 17 Oct 2003 16:27:26 +0000 (16:27 +0000)
* add server support for DsEnumerateDomainTrusts()
(This used to be commit 06bacf6e3434db5bd09b48f84206441712e69a63)

source3/passdb/pdb_gums.c
source3/rpc_server/srv_netlog.c
source3/rpc_server/srv_netlog_nt.c
source3/sam/gums_helper.c

index dd6e682452b39872c9a7780ba80cff2ee2925c11..caf98e648a16d3ade596d8e4d945222cad76f930 100644 (file)
@@ -286,6 +286,8 @@ static NTSTATUS gums_getsampwrid (struct pdb_methods *methods,
        sid_copy(&sid, get_global_sam_sid());
        sid_append_rid(&sid, rid);
        gums_getsampwsid(methods, account, &sid);
+
+       return NT_STATUS_OK;
 }
 
 
index 9c10d86379dff4f3f75d225292ea82440725da34..0ef9b088a91a0871a34d91773383aa978aaef748 100644 (file)
@@ -317,6 +317,40 @@ static BOOL api_net_logon_ctrl(pipes_struct *p)
        return True;
 }
 
+/*************************************************************************
+ api_ds_enum_dom_trusts:
+ *************************************************************************/
+
+static BOOL api_ds_enum_dom_trusts(pipes_struct *p)
+{
+       DS_Q_ENUM_DOM_TRUSTS q_u;
+       DS_R_ENUM_DOM_TRUSTS r_u;
+
+       prs_struct *data = &p->in_data.data;
+       prs_struct *rdata = &p->out_data.rdata;
+
+       ZERO_STRUCT(q_u);
+       ZERO_STRUCT(r_u);
+
+       DEBUG(6,("api_ds_enum_dom_trusts\n"));
+
+       if ( !ds_io_q_enum_domain_trusts("", data, 0, &q_u) ) {
+               DEBUG(0,("api_ds_enum_domain_trusts: Failed to unmarshall DS_Q_ENUM_DOM_TRUSTS.\n"));
+               return False;
+       }
+
+       r_u.status = _ds_enum_dom_trusts(p, &q_u, &r_u);
+
+       if ( !ds_io_r_enum_domain_trusts("", rdata, 0, &r_u) ) {
+               DEBUG(0,("api_ds_enum_domain_trusts: Failed to marshall DS_R_ENUM_DOM_TRUSTS.\n"));
+               return False;
+       }
+
+       DEBUG(6,("api_ds_enum_dom_trusts\n"));
+
+       return True;
+}
+
 /*******************************************************************
  array of \PIPE\NETLOGON operations
  ********************************************************************/
@@ -330,7 +364,8 @@ static struct api_struct api_net_cmds [] =
       { "NET_SAMLOGOFF"     , NET_SAMLOGOFF     , api_net_sam_logoff     }, 
       { "NET_LOGON_CTRL2"   , NET_LOGON_CTRL2   , api_net_logon_ctrl2    }, 
       { "NET_TRUST_DOM_LIST", NET_TRUST_DOM_LIST, api_net_trust_dom_list },
-      { "NET_LOGON_CTRL"    , NET_LOGON_CTRL    , api_net_logon_ctrl     }
+      { "NET_LOGON_CTRL"    , NET_LOGON_CTRL    , api_net_logon_ctrl     },
+      { "DS_ENUM_DOM_TRUSTS", DS_ENUM_DOM_TRUSTS, api_ds_enum_dom_trusts }
     };
 
 void netlog_get_pipe_fns( struct api_struct **fns, int *n_fns )
index 602cd7d2d505e3906c8e384594513fbd2204ae8f..66fa6e7678d1e4e1c8dadedf828935507ac96871 100644 (file)
@@ -762,4 +762,18 @@ NTSTATUS _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *
        return status;
 }
 
+/*************************************************************************
+ _ds_enum_dom_trusts
+ *************************************************************************/
+NTSTATUS _ds_enum_dom_trusts(pipes_struct *p, DS_Q_ENUM_DOM_TRUSTS *q_u,
+                            DS_R_ENUM_DOM_TRUSTS *r_u)
+{
+       NTSTATUS status = NT_STATUS_OK;
 
+       /* We just return zero trusts for now. At least that way we're
+          consistent with NetTrustedDomainList which is what the fallback
+          for this function is. Both of these functions need to be
+          reworked. */
+
+       return status;
+}
index 15486d094c69c643ca3ecac45804e5f899c813af..5bbd054be1457aa18ed6b0f692729bd87d52ace1 100644 (file)
@@ -173,7 +173,6 @@ NTSTATUS gums_make_domain(DOM_SID *sid, const char *name, const char *descriptio
 
        ret = fns->set_object(go);
 
-done:
        gums_destroy_object(&go);
        return ret;
 }
@@ -208,7 +207,6 @@ NTSTATUS gums_make_alias(DOM_SID *sid, const char *name, const char *description
 
        ret = fns->set_object(go);
 
-done:
        gums_destroy_object(&go);
        return ret;
 }