s4:rpc_server: only pass context to op_bind() hooks
authorStefan Metzmacher <metze@samba.org>
Wed, 21 Nov 2018 19:06:21 +0000 (20:06 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 12 Jan 2019 02:13:39 +0000 (03:13 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
15 files changed:
pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm
source4/rpc_server/backupkey/dcesrv_backupkey.c
source4/rpc_server/backupkey/dcesrv_backupkey_heimdal.c
source4/rpc_server/dcerpc_server.c
source4/rpc_server/dcerpc_server.h
source4/rpc_server/dcesrv_mgmt.c
source4/rpc_server/dnsserver/dcerpc_dnsserver.c
source4/rpc_server/drsuapi/dcesrv_drsuapi.c
source4/rpc_server/echo/rpc_echo.c
source4/rpc_server/epmapper/rpc_epmapper.c
source4/rpc_server/lsa/dcesrv_lsa.c
source4/rpc_server/netlogon/dcerpc_netlogon.c
source4/rpc_server/remote/dcesrv_remote.c
source4/rpc_server/samr/dcesrv_samr.c
source4/torture/rpc/spoolss_notify.c

index ad36f00..e228a76 100644 (file)
@@ -81,10 +81,10 @@ sub Boilerplate_Iface($)
        my $if_version = $interface->{VERSION};
 
        pidl "
-static NTSTATUS $name\__op_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface, uint32_t if_version)
+static NTSTATUS $name\__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
 {
 #ifdef DCESRV_INTERFACE_$uname\_BIND
-       return DCESRV_INTERFACE_$uname\_BIND(dce_call,iface);
+       return DCESRV_INTERFACE_$uname\_BIND(context,iface);
 #else
        return NT_STATUS_OK;
 #endif
index 307a7f0..a826ae0 100644 (file)
 #include <gnutls/crypto.h>
 #include <gnutls/abstract.h>
 
-#define DCESRV_INTERFACE_BACKUPKEY_BIND(call, iface) \
-       dcesrv_interface_backupkey_bind(call, iface)
-static NTSTATUS dcesrv_interface_backupkey_bind(struct dcesrv_call_state *dce_call,
+#define DCESRV_INTERFACE_BACKUPKEY_BIND(context, iface) \
+       dcesrv_interface_backupkey_bind(context, iface)
+static NTSTATUS dcesrv_interface_backupkey_bind(struct dcesrv_connection_context *context,
                                                const struct dcesrv_interface *iface)
 {
-       struct dcesrv_connection_context *context = dce_call->context;
        return dcesrv_interface_bind_require_privacy(context, iface);
 }
 
index 05113a9..60d0823 100644 (file)
 #include <gcrypt.h>
 #endif
 
-#define DCESRV_INTERFACE_BACKUPKEY_BIND(call, iface) \
-       dcesrv_interface_backupkey_bind(call, iface)
-static NTSTATUS dcesrv_interface_backupkey_bind(struct dcesrv_call_state *dce_call,
+#define DCESRV_INTERFACE_BACKUPKEY_BIND(context, iface) \
+       dcesrv_interface_backupkey_bind(context, iface)
+static NTSTATUS dcesrv_interface_backupkey_bind(struct dcesrv_connection_context *context,
                                                const struct dcesrv_interface *iface)
 {
-       struct dcesrv_connection_context *context = dce_call->context;
        return dcesrv_interface_bind_require_privacy(context, iface);
 }
 
index 9717a24..d9ed390 100644 (file)
@@ -1510,7 +1510,7 @@ static NTSTATUS dcesrv_check_or_create_context(struct dcesrv_call_state *call,
         */
        call->state_flags |= DCESRV_CALL_STATE_FLAG_MULTIPLEXED;
 
-       status = iface->bind(call, iface, if_version);
+       status = iface->bind(context, iface);
        call->context = NULL;
        if (!NT_STATUS_IS_OK(status)) {
                /* we don't want to trigger the iface->unbind() hook */
index dfe4888..8e404c0 100644 (file)
@@ -45,7 +45,7 @@ struct dcesrv_interface {
        struct ndr_syntax_id syntax_id;
 
        /* this function is called when the client binds to this interface  */
-       NTSTATUS (*bind)(struct dcesrv_call_state *, const struct dcesrv_interface *, uint32_t if_version);
+       NTSTATUS (*bind)(struct dcesrv_connection_context *, const struct dcesrv_interface *);
 
        /* this function is called when the client disconnects the endpoint */
        void (*unbind)(struct dcesrv_connection_context *, const struct dcesrv_interface *);
index 210a86d..e520a34 100644 (file)
@@ -24,8 +24,8 @@
 #include "rpc_server/dcerpc_server_proto.h"
 #include "librpc/gen_ndr/ndr_mgmt.h"
 
-#define DCESRV_INTERFACE_MGMT_BIND(call, iface) \
-       dcesrv_interface_mgmt_bind(call, iface)
+#define DCESRV_INTERFACE_MGMT_BIND(context, iface) \
+       dcesrv_interface_mgmt_bind(context, iface)
 /*
  * This #define allows the mgmt interface to accept invalid
  * association groups, because association groups are to coordinate
 
 #define DCESRV_INTERFACE_MGMT_FLAGS DCESRV_INTERFACE_FLAGS_HANDLES_NOT_USED
 
-static NTSTATUS dcesrv_interface_mgmt_bind(struct dcesrv_call_state *dce_call,
+static NTSTATUS dcesrv_interface_mgmt_bind(struct dcesrv_connection_context *context,
                                             const struct dcesrv_interface *iface)
 {
-       struct dcesrv_connection_context *context = dce_call->context;
        return dcesrv_interface_bind_allow_connect(context, iface);
 }
 
index 7c2ca8e..8415578 100644 (file)
 #include "dns_server/dnsserver_common.h"
 #include "dnsserver.h"
 
-#define DCESRV_INTERFACE_DNSSERVER_BIND(call, iface) \
-       dcesrv_interface_dnsserver_bind(call, iface)
-static NTSTATUS dcesrv_interface_dnsserver_bind(struct dcesrv_call_state *dce_call,
+#define DCESRV_INTERFACE_DNSSERVER_BIND(context, iface) \
+       dcesrv_interface_dnsserver_bind(context, iface)
+static NTSTATUS dcesrv_interface_dnsserver_bind(struct dcesrv_connection_context *context,
                                                const struct dcesrv_interface *iface)
 {
-       struct dcesrv_connection_context *context = dce_call->context;
        return dcesrv_interface_bind_require_integrity(context, iface);
 }
 
index 347823e..7e2b617 100644 (file)
        DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR); \
 } while (0)
 
-#define DCESRV_INTERFACE_DRSUAPI_BIND(call, iface) \
-       dcesrv_interface_drsuapi_bind(call, iface)
-static NTSTATUS dcesrv_interface_drsuapi_bind(struct dcesrv_call_state *dce_call,
+#define DCESRV_INTERFACE_DRSUAPI_BIND(context, iface) \
+       dcesrv_interface_drsuapi_bind(context, iface)
+static NTSTATUS dcesrv_interface_drsuapi_bind(struct dcesrv_connection_context *context,
                                              const struct dcesrv_interface *iface)
 {
-       struct dcesrv_connection_context *context = dce_call->context;
        return dcesrv_interface_bind_require_privacy(context, iface);
 }
 
index e00eaec..b0baf82 100644 (file)
 #include "librpc/gen_ndr/ndr_echo.h"
 #include "lib/events/events.h"
 
-#define DCESRV_INTERFACE_RPCECHO_BIND(call, iface) \
-       dcesrv_interface_rpcecho_bind(call, iface)
-static NTSTATUS dcesrv_interface_rpcecho_bind(struct dcesrv_call_state *dce_call,
+#define DCESRV_INTERFACE_RPCECHO_BIND(context, iface) \
+       dcesrv_interface_rpcecho_bind(context, iface)
+static NTSTATUS dcesrv_interface_rpcecho_bind(struct dcesrv_connection_context *context,
                                              const struct dcesrv_interface *iface)
 {
-       struct dcesrv_connection_context *context = dce_call->context;
        return dcesrv_interface_bind_allow_connect(context, iface);
 }
 
index 7e9c261..793070d 100644 (file)
 #include "librpc/gen_ndr/ndr_epmapper.h"
 #include "rpc_server/dcerpc_server.h"
 
-#define DCESRV_INTERFACE_EPMAPPER_BIND(call, iface) \
-       dcesrv_interface_epmapper_bind(call, iface)
-static NTSTATUS dcesrv_interface_epmapper_bind(struct dcesrv_call_state *dce_call,
+#define DCESRV_INTERFACE_EPMAPPER_BIND(context, iface) \
+       dcesrv_interface_epmapper_bind(context, iface)
+static NTSTATUS dcesrv_interface_epmapper_bind(struct dcesrv_connection_context *context,
                                             const struct dcesrv_interface *iface)
 {
-       struct dcesrv_connection_context *context = dce_call->context;
        return dcesrv_interface_bind_allow_connect(context, iface);
 }
 
index 4a1bf60..ec3be02 100644 (file)
 #include "lib/messaging/irpc.h"
 #include "libds/common/roles.h"
 
-#define DCESRV_INTERFACE_LSARPC_BIND(call, iface) \
-       dcesrv_interface_lsarpc_bind(call, iface)
-static NTSTATUS dcesrv_interface_lsarpc_bind(struct dcesrv_call_state *dce_call,
+#define DCESRV_INTERFACE_LSARPC_BIND(context, iface) \
+       dcesrv_interface_lsarpc_bind(context, iface)
+static NTSTATUS dcesrv_interface_lsarpc_bind(struct dcesrv_connection_context *context,
                                             const struct dcesrv_interface *iface)
 {
-       struct dcesrv_connection_context *context = dce_call->context;
        return dcesrv_interface_bind_reject_connect(context, iface);
 }
 
index ca3dba3..530350d 100644 (file)
@@ -45,8 +45,8 @@
 #include "rpc_server/common/sid_helper.h"
 #include "lib/util/util_str_escape.h"
 
-#define DCESRV_INTERFACE_NETLOGON_BIND(call, iface) \
-       dcesrv_interface_netlogon_bind(call, iface)
+#define DCESRV_INTERFACE_NETLOGON_BIND(context, iface) \
+       dcesrv_interface_netlogon_bind(context, iface)
 
 /*
  * This #define allows the netlogon interface to accept invalid
  */
 #define DCESRV_INTERFACE_NETLOGON_FLAGS DCESRV_INTERFACE_FLAGS_HANDLES_NOT_USED
 
-static NTSTATUS dcesrv_interface_netlogon_bind(struct dcesrv_call_state *dce_call,
+static NTSTATUS dcesrv_interface_netlogon_bind(struct dcesrv_connection_context *context,
                                               const struct dcesrv_interface *iface)
 {
-       struct dcesrv_connection_context *context = dce_call->context;
        return dcesrv_interface_bind_reject_connect(context, iface);
 }
 
index a4abb4b..0d3b123 100644 (file)
@@ -45,7 +45,8 @@ static NTSTATUS remote_op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *
        return NT_STATUS_OK;
 }
 
-static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface, uint32_t if_version)
+static NTSTATUS remote_op_bind(struct dcesrv_connection_context *context,
+                              const struct dcesrv_interface *iface)
 {
        return NT_STATUS_OK;
 }
index 0ddbaae..51fed4d 100644 (file)
 #include "lib/util/tsort.h"
 #include "libds/common/flag_mapping.h"
 
-#define DCESRV_INTERFACE_SAMR_BIND(call, iface) \
-       dcesrv_interface_samr_bind(call, iface)
-static NTSTATUS dcesrv_interface_samr_bind(struct dcesrv_call_state *dce_call,
+#define DCESRV_INTERFACE_SAMR_BIND(context, iface) \
+       dcesrv_interface_samr_bind(context, iface)
+static NTSTATUS dcesrv_interface_samr_bind(struct dcesrv_connection_context *context,
                                             const struct dcesrv_interface *iface)
 {
-       struct dcesrv_connection_context *context = dce_call->context;
        return dcesrv_interface_bind_reject_connect(context, iface);
 }
 
index 718ae70..2dd1299 100644 (file)
@@ -33,9 +33,8 @@
 #include "ntvfs/ntvfs.h"
 #include "param/param.h"
 
-static NTSTATUS spoolss__op_bind(struct dcesrv_call_state *dce_call,
-                                const struct dcesrv_interface *iface,
-                                uint32_t if_version)
+static NTSTATUS spoolss__op_bind(struct dcesrv_connection_context *context,
+                                const struct dcesrv_interface *iface)
 {
        return NT_STATUS_OK;
 }