s3: rpc_server: Remove dead code
authorSamuel Cabrero <scabrero@suse.de>
Mon, 4 Nov 2019 18:01:28 +0000 (19:01 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 24 May 2020 23:55:37 +0000 (23:55 +0000)
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm
source3/rpc_server/rpc_contexts.c [deleted file]
source3/rpc_server/rpc_contexts.h [deleted file]
source3/rpc_server/rpc_handles.c
source3/rpc_server/rpc_ncacn_np.c
source3/rpc_server/rpc_pipes.h
source3/rpc_server/rpc_server.c
source3/rpc_server/spoolss/srv_iremotewinspool.c
source3/rpc_server/wscript_build

index 28d42efb58864925b45332a7887d85d2fa8cc686..54feea0a9ef15b46f8db0957c63cd3595e15fcd8 100644 (file)
@@ -227,48 +227,10 @@ sub boilerplate_iface($)
        $self->pidl("{");
        $self->indent();
        $self->pidl("struct pipes_struct *p = NULL;");
-       $self->pidl("struct pipe_rpc_fns *context_fns = NULL;");
-       $self->pidl("bool ok = false;");
        $self->pidl("");
        $self->pidl("/* Retrieve pipes struct */");
        $self->pidl("p = dcesrv_get_pipes_struct(context->conn);");
-       $self->pidl("");
-
-       $self->pidl("/* TODO check loop */");
-
-       $self->pidl("/* Init pipe context */");
        $self->pidl("p->pipe_bound = true;");
-       $self->pidl("for (context_fns = p->contexts; context_fns != NULL; context_fns = context_fns->next) {");
-       $self->indent();
-       $self->pidl("if (context_fns->context_id != context->context_id) {");
-       $self->indent();
-       $self->pidl("continue;");
-       $self->deindent();
-       $self->pidl("}");
-       $self->pidl("ok = ndr_syntax_id_equal(&context_fns->syntax, &iface->syntax_id);");
-       $self->pidl("if (ok) {");
-       $self->indent();
-       $self->pidl("break;");
-       $self->deindent();
-       $self->pidl("}");
-       $self->pidl("return NT_STATUS_UNSUCCESSFUL;");
-       $self->deindent();
-       $self->pidl("}");
-       $self->pidl("if (context_fns == NULL) {");
-       $self->indent();
-       $self->pidl("context_fns = talloc_zero(p, struct pipe_rpc_fns);");
-       $self->pidl("if (context_fns == NULL) {");
-       $self->indent();
-       $self->pidl("return NT_STATUS_NO_MEMORY;");
-       $self->deindent();
-       $self->pidl("}");
-       $self->pidl("");
-       $self->pidl("context_fns->next = context_fns->prev = NULL;");
-       $self->pidl("context_fns->context_id = context->context_id;");
-       $self->pidl("context_fns->syntax = iface->syntax_id;");
-       $self->pidl("DLIST_ADD( p->contexts, context_fns);");
-       $self->deindent();
-       $self->pidl("}");
        $self->pidlnoindent("#ifdef DCESRV_INTERFACE_$uname\_BIND");
        $self->pidl("return DCESRV_INTERFACE_$uname\_BIND(context,iface);");
        $self->pidlnoindent("#else");
diff --git a/source3/rpc_server/rpc_contexts.c b/source3/rpc_server/rpc_contexts.c
deleted file mode 100644 (file)
index 131bea2..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *  Unix SMB/CIFS implementation.
- *  RPC Pipe client / server routines
- *  Almost completely rewritten by (C) Jeremy Allison 2005 - 2010
- *
- *  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 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  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, see <http://www.gnu.org/licenses/>.
- */
-
-#include "includes.h"
-#include "ntdomain.h"
-
-#include "rpc_contexts.h"
-
-#undef DBGC_CLASS
-#define DBGC_CLASS DBGC_RPC_SRV
-
-struct pipe_rpc_fns *find_pipe_fns_by_context(struct pipe_rpc_fns *list,
-                                             uint32_t context_id)
-{
-       struct pipe_rpc_fns *fns = NULL;
-
-       if ( !list ) {
-               DEBUG(0,("find_pipe_fns_by_context: ERROR!  No context list for pipe!\n"));
-               return NULL;
-       }
-
-       for (fns=list; fns; fns=fns->next ) {
-               if ( fns->context_id == context_id )
-                       return fns;
-       }
-       return NULL;
-}
diff --git a/source3/rpc_server/rpc_contexts.h b/source3/rpc_server/rpc_contexts.h
deleted file mode 100644 (file)
index 8463414..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *  Unix SMB/CIFS implementation.
- *  RPC Pipe client / server routines
- *  Almost completely rewritten by (C) Jeremy Allison 2005 - 2010
- *
- *  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 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  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, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _RPC_SERVER_RPC_CONTEXTS_H_
-#define _RPC_SERVER_RPC_CONTEXTS_H_
-
-struct pipe_rpc_fns;
-
-struct pipe_rpc_fns *find_pipe_fns_by_context(struct pipe_rpc_fns *list,
-                                             uint32_t context_id);
-
-#endif /* _RPC_SERVER_RPC_CONTEXTS_H_*/
index f0ff99736d8c3abb1d624ea7c28549ff1a036fed..0134abc5c601ee367b99653deee3e6698e038021 100644 (file)
@@ -49,7 +49,6 @@ int make_base_pipes_struct(TALLOC_CTX *mem_ctx,
                           struct messaging_context *msg_ctx,
                           const char *pipe_name,
                           enum dcerpc_transport_t transport,
-                          bool endian,
                           const struct tsocket_address *remote_address,
                           const struct tsocket_address *local_address,
                           struct pipes_struct **_p)
@@ -69,7 +68,6 @@ int make_base_pipes_struct(TALLOC_CTX *mem_ctx,
 
        p->msg_ctx = msg_ctx;
        p->transport = transport;
-       p->endian = endian;
 
        p->remote_address = tsocket_address_copy(remote_address, p);
        if (p->remote_address == NULL) {
index 1855a12f565681d978786af77a3081c51ef18542..625b28c9209def8dbd4af9b36bd630c113111040 100644 (file)
@@ -34,7 +34,6 @@
 #include "rpc_server/rpc_pipes.h"
 #include "../lib/tsocket/tsocket.h"
 #include "../lib/util/tevent_ntstatus.h"
-#include "rpc_contexts.h"
 #include "rpc_server/rpc_config.h"
 #include "librpc/ndr/ndr_table.h"
 #include "rpc_server/rpc_server.h"
@@ -249,7 +248,6 @@ static NTSTATUS make_internal_ncacn_conn(TALLOC_CTX *mem_ctx,
                                struct messaging_context *msg_ctx,
                                struct dcerpc_ncacn_conn **_out)
 {
-       struct pipe_rpc_fns *context_fns;
        struct dcerpc_ncacn_conn *ncacn_conn = NULL;
        const char *pipe_name = NULL;
        NTSTATUS status;
@@ -296,7 +294,6 @@ static NTSTATUS make_internal_ncacn_conn(TALLOC_CTX *mem_ctx,
                                     msg_ctx,
                                     pipe_name,
                                     NCALRPC,
-                                    RPC_LITTLE_ENDIAN,
                                     ncacn_conn->remote_client_addr,
                                     ncacn_conn->local_server_addr,
                                     &ncacn_conn->p);
@@ -306,20 +303,6 @@ static NTSTATUS make_internal_ncacn_conn(TALLOC_CTX *mem_ctx,
                goto fail;
        }
 
-       context_fns = talloc_zero(ncacn_conn->p, struct pipe_rpc_fns);
-       if (context_fns == NULL) {
-               DBG_ERR("No memory");
-               status = NT_STATUS_NO_MEMORY;
-               goto fail;
-       }
-
-       context_fns->next = context_fns->prev = NULL;
-       context_fns->context_id = 0;
-       context_fns->syntax = table->syntax_id;
-
-       /* add to the list of open contexts */
-       DLIST_ADD(ncacn_conn->p->contexts, context_fns);
-
        DEBUG(4,("Created internal pipe %s\n", pipe_name));
 
        *_out = ncacn_conn;
index 5102f01b77e8f2ce5444f8dd28abf69b4cc7b72a..902a996d018957336c45718c1c6e2ed66e1ae0da 100644 (file)
 
 struct dcesrv_ep_entry_list;
 struct tsocket_address;
-struct handle_list;
 struct pipes_struct;
 struct dcesrv_context;
 
-struct pipe_rpc_fns {
-
-       struct pipe_rpc_fns *next, *prev;
-
-       /* RPC function table associated with the current rpc_bind (associated by context) */
-
-       uint32_t context_id;
-       struct ndr_syntax_id syntax;
-
-       /*
-        * shall we allow "connect" auth level for this interface ?
-        */
-       bool allow_connect;
-
-       /*
-        * minimal required auth level
-        */
-       enum dcerpc_AuthLevel min_auth_level;
-};
-
 /*
  * DCE/RPC-specific samba-internal-specific handling of data on
  * NamedPipes.
@@ -69,11 +48,6 @@ struct pipes_struct {
 
        struct dcesrv_ep_entry_list *ep_entries;
 
-       /* linked list of rpc dispatch tables associated 
-          with the open rpc contexts */
-
-       struct pipe_rpc_fns *contexts;
-
        struct pipe_auth_data auth;
 
        /*
@@ -86,17 +60,11 @@ struct pipes_struct {
         */
        int fault_state;
 
-       /*
-        * Set to RPC_BIG_ENDIAN when dealing with big-endian PDU's
-        */
-       bool endian;
-
        /* This context is used for PDU data and is freed between each pdu.
                Don't use for pipe state storage. */
        TALLOC_CTX *mem_ctx;
 
        /* handle database to use on this pipe. */
-       struct handle_list *pipe_handles;
        struct dcesrv_call_state *dce_call;
 
        /* call id retrieved from the pdu header */
@@ -114,7 +82,6 @@ int make_base_pipes_struct(TALLOC_CTX *mem_ctx,
                           struct messaging_context *msg_ctx,
                           const char *pipe_name,
                           enum dcerpc_transport_t transport,
-                          bool endian,
                           const struct tsocket_address *remote_address,
                           const struct tsocket_address *local_address,
                           struct pipes_struct **_p);
index d34f85538cd13f7559c93d207515437c6107daf2..4037c81cfc8cb3154c69fd20473568a38cf3cfcb 100644 (file)
@@ -53,7 +53,7 @@ int make_server_pipes_struct(TALLOC_CTX *mem_ctx,
        int ret;
 
        ret = make_base_pipes_struct(mem_ctx, msg_ctx, pipe_name,
-                                    transport, RPC_LITTLE_ENDIAN,
+                                    transport,
                                     remote_address, local_address, &p);
        if (ret) {
                *perrno = ret;
index 6d9055936db648bf78eb2a70033de4eb7cfda530..26b225818f8ce9a4d398ac33efdaec69fad579cd 100644 (file)
@@ -34,36 +34,10 @@ static bool forward_opnum_to_spoolss(uint16_t opnum) {
 static NTSTATUS iremotewinspool__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
 {
        struct pipes_struct *p = NULL;
-       struct pipe_rpc_fns *context_fns = NULL;
-       bool ok = false;
 
        /* Retrieve pipes struct */
        p = dcesrv_get_pipes_struct(context->conn);
-
-       /* TODO check loop */
-       /* Init pipe context */
        p->pipe_bound = true;
-       for (context_fns = p->contexts; context_fns != NULL; context_fns = context_fns->next) {
-               if (context_fns->context_id != context->context_id) {
-                       continue;
-               }
-               ok = ndr_syntax_id_equal(&context_fns->syntax, &iface->syntax_id);
-               if (ok) {
-                       break;
-               }
-               return NT_STATUS_UNSUCCESSFUL;
-       }
-       if (context_fns == NULL) {
-               context_fns = talloc_zero(p, struct pipe_rpc_fns);
-               if (context_fns == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-               }
-
-               context_fns->next = context_fns->prev = NULL;
-               context_fns->context_id = context->context_id;
-               context_fns->syntax = iface->syntax_id;
-               DLIST_ADD( p->contexts, context_fns);
-       }
 #ifdef DCESRV_INTERFACE_IREMOTEWINSPOOL_BIND
        return DCESRV_INTERFACE_IREMOTEWINSPOOL_BIND(context,iface);
 #else
index 791907fdc93801f5caa2a8b842dfefa10fa1dfa7..2af02ad6fa8c2a01b50d1e70fa09338a60199b4c 100644 (file)
@@ -10,7 +10,7 @@ bld.SAMBA3_SUBSYSTEM('RPC_CONFIG',
                     deps='talloc')
 
 bld.SAMBA3_SUBSYSTEM('RPC_NCACN_NP',
-                    source='rpc_ncacn_np.c rpc_handles.c rpc_contexts.c',
+                    source='rpc_ncacn_np.c rpc_handles.c',
                     deps='RPC_CONFIG auth common_auth npa_tstream')
 
 bld.SAMBA3_SUBSYSTEM('RPC_SERVER_LOOP',