From: Samuel Cabrero Date: Mon, 4 Nov 2019 18:01:28 +0000 (+0100) Subject: s3: rpc_server: Remove dead code X-Git-Tag: samba-4.13.0rc1~431 X-Git-Url: http://git.samba.org/samba.git/?a=commitdiff_plain;h=10cea64e4c9c1dec67278ca1b40f40ae90e58c34;p=samba.git s3: rpc_server: Remove dead code Signed-off-by: Samuel Cabrero Reviewed-by: Andrew Bartlett --- diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm index 28d42efb588..54feea0a9ef 100644 --- a/pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm +++ b/pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm @@ -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 index 131bea21fd6..00000000000 --- a/source3/rpc_server/rpc_contexts.c +++ /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 . - */ - -#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 index 8463414bbb3..00000000000 --- a/source3/rpc_server/rpc_contexts.h +++ /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 . - */ - -#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_*/ diff --git a/source3/rpc_server/rpc_handles.c b/source3/rpc_server/rpc_handles.c index f0ff99736d8..0134abc5c60 100644 --- a/source3/rpc_server/rpc_handles.c +++ b/source3/rpc_server/rpc_handles.c @@ -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) { diff --git a/source3/rpc_server/rpc_ncacn_np.c b/source3/rpc_server/rpc_ncacn_np.c index 1855a12f565..625b28c9209 100644 --- a/source3/rpc_server/rpc_ncacn_np.c +++ b/source3/rpc_server/rpc_ncacn_np.c @@ -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; diff --git a/source3/rpc_server/rpc_pipes.h b/source3/rpc_server/rpc_pipes.h index 5102f01b77e..902a996d018 100644 --- a/source3/rpc_server/rpc_pipes.h +++ b/source3/rpc_server/rpc_pipes.h @@ -28,30 +28,9 @@ 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); diff --git a/source3/rpc_server/rpc_server.c b/source3/rpc_server/rpc_server.c index d34f85538cd..4037c81cfc8 100644 --- a/source3/rpc_server/rpc_server.c +++ b/source3/rpc_server/rpc_server.c @@ -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; diff --git a/source3/rpc_server/spoolss/srv_iremotewinspool.c b/source3/rpc_server/spoolss/srv_iremotewinspool.c index 6d9055936db..26b225818f8 100644 --- a/source3/rpc_server/spoolss/srv_iremotewinspool.c +++ b/source3/rpc_server/spoolss/srv_iremotewinspool.c @@ -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 diff --git a/source3/rpc_server/wscript_build b/source3/rpc_server/wscript_build index 791907fdc93..2af02ad6fa8 100644 --- a/source3/rpc_server/wscript_build +++ b/source3/rpc_server/wscript_build @@ -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',