r23792: convert Samba4 to GPLv3
[bbaumbach/samba-autobuild/.git] / source4 / rpc_server / remote / dcesrv_remote.c
index 4517847b74c3b2b1c10debf72a71b796e722b5a3..2071aa219916d3bc03e610cb4701d96cc0c6cfd1 100644 (file)
@@ -6,7 +6,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
 #include "rpc_server/dcerpc_server.h"
 #include "auth/auth.h"
+#include "auth/credentials/credentials.h"
 #include "librpc/rpc/dcerpc_table.h"
 
 
@@ -29,6 +29,11 @@ struct dcesrv_remote_private {
        struct dcerpc_pipe *c_pipe;
 };
 
+static NTSTATUS remote_op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
+{
+       return NT_STATUS_OK;
+}
+
 static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface)
 {
         NTSTATUS status;
@@ -58,7 +63,7 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct
        pass = lp_parm_string(-1, "dcerpc_remote", "password");
        domain = lp_parm_string(-1, "dceprc_remote", "domain");
 
-       table = idl_iface_by_uuid(&iface->uuid); /* FIXME: What about if_version ? */
+       table = idl_iface_by_uuid(&iface->syntax_id.uuid); /* FIXME: What about if_version ? */
        if (!table) {
                dce_call->fault_code = DCERPC_FAULT_UNK_IF;
                return NT_STATUS_NET_WRITE_FAULT;
@@ -161,6 +166,8 @@ static NTSTATUS remote_op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CT
                ndr_print_function_debug(call->ndr_print, name, NDR_IN | NDR_SET_VALUES, r);            
        }
 
+       private->c_pipe->conn->flags |= DCERPC_NDR_REF_ALLOC;
+
        /* we didn't use the return code of this function as we only check the last_fault_code */
        dcerpc_ndr_request(private->c_pipe, NULL, table, opnum, mem_ctx,r);
 
@@ -248,14 +255,14 @@ static NTSTATUS remote_op_init_server(struct dcesrv_context *dce_ctx, const stru
 static BOOL remote_fill_interface(struct dcesrv_interface *iface, const struct dcerpc_interface_table *if_tabl)
 {
        iface->name = if_tabl->name;
-       iface->uuid = if_tabl->uuid;
-       iface->if_version = if_tabl->if_version;
+       iface->syntax_id = if_tabl->syntax_id;
        
        iface->bind = remote_op_bind;
        iface->unbind = remote_op_unbind;
 
        iface->ndr_pull = remote_op_ndr_pull;
        iface->dispatch = remote_op_dispatch;
+       iface->reply = remote_op_reply;
        iface->ndr_push = remote_op_ndr_push;
 
        iface->private = if_tabl;
@@ -268,8 +275,8 @@ static BOOL remote_op_interface_by_uuid(struct dcesrv_interface *iface, const st
        const struct dcerpc_interface_list *l;
 
        for (l=librpc_dcerpc_pipes();l;l=l->next) {
-               if (l->table->if_version == if_version &&
-                       GUID_equal(&l->table->uuid, uuid)==0) {
+               if (l->table->syntax_id.if_version == if_version &&
+                       GUID_equal(&l->table->syntax_id.uuid, uuid)==0) {
                        return remote_fill_interface(iface, l->table);
                }
        }