rpc_server3: Remove pipes_struct->pipe_bound
authorVolker Lendecke <vl@samba.org>
Mon, 4 Oct 2021 10:49:56 +0000 (12:49 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 5 Jan 2022 00:11:37 +0000 (00:11 +0000)
Only used in pipe_access_check(), superseded by dcesrv_call_auth_info()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm
source3/rpc_server/rpc_handles.c
source3/rpc_server/rpc_pipes.h
source3/rpc_server/spoolss/srv_iremotewinspool.c

index 9ea70a3af93ea87ae8182d7301d2084d20c3517f..78dc6a8aff69b2e8d265022e744d5f5f33db367d 100644 (file)
@@ -226,11 +226,6 @@ sub boilerplate_iface($)
        $self->pidl("static NTSTATUS $name\__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)");
        $self->pidl("{");
        $self->indent();
-       $self->pidl("struct pipes_struct *p = NULL;");
-       $self->pidl("");
-       $self->pidl("/* Retrieve pipes struct */");
-       $self->pidl("p = dcesrv_get_pipes_struct(context->conn);");
-       $self->pidl("p->pipe_bound = true;");
        $self->pidlnoindent("#ifdef DCESRV_INTERFACE_$uname\_BIND");
        $self->pidl("return DCESRV_INTERFACE_$uname\_BIND(context,iface);");
        $self->pidlnoindent("#else");
index e316505a535d3449eb90f2fe2b4a9a5fdb64be1c..ec8cfe090fe56ea8d56497701a82548fa3c822db 100644 (file)
@@ -204,9 +204,18 @@ bool pipe_access_check(struct pipes_struct *p)
 
        if (lp_restrict_anonymous() > 0) {
 
+               struct dcesrv_call_state *dce_call = p->dce_call;
+               struct dcesrv_auth *auth_state = dce_call->auth_state;
+               enum dcerpc_AuthType auth_type = DCERPC_AUTH_TYPE_NONE;
+
+               if (!auth_state->auth_finished) {
+                       return false;
+               }
+
+               dcesrv_call_auth_info(dce_call, &auth_type, NULL);
+
                /* schannel, so we must be ok */
-               if (p->pipe_bound &&
-                   (p->auth.auth_type == DCERPC_AUTH_TYPE_SCHANNEL)) {
+               if (auth_type == DCERPC_AUTH_TYPE_SCHANNEL) {
                        return True;
                }
 
index 48e15dfdf52b48cbcc97a5b258c9a199ee6a8260..5aa5a05e4708985f9b874fae6becea6b5e6fae61 100644 (file)
@@ -44,11 +44,6 @@ struct pipes_struct {
 
        struct pipe_auth_data auth;
 
-       /*
-        * Set to true when an RPC bind has been done on this pipe.
-        */
-       bool pipe_bound;
-
        /*
         * Set the DCERPC_FAULT to return.
         */
index 58618ac172b8b09ea75050eb66c5167662201eda..f93d2f676d89bf3ad19da8bed0e3eb2d5137ff5e 100644 (file)
@@ -33,11 +33,6 @@ static bool forward_opnum_to_spoolss(uint16_t opnum) {
 /* iremotewinspool - dcerpc server boilerplate generated by pidl */
 static NTSTATUS iremotewinspool__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
 {
-       struct pipes_struct *p = NULL;
-
-       /* Retrieve pipes struct */
-       p = dcesrv_get_pipes_struct(context->conn);
-       p->pipe_bound = true;
 #ifdef DCESRV_INTERFACE_IREMOTEWINSPOOL_BIND
        return DCESRV_INTERFACE_IREMOTEWINSPOOL_BIND(context,iface);
 #else