]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:librpc/rpc: call dcerpc_binding_set_abstract_syntax after bind or alter context
authorStefan Metzmacher <metze@samba.org>
Wed, 18 Sep 2024 21:25:34 +0000 (23:25 +0200)
committerJule Anger <janger@samba.org>
Thu, 12 Jun 2025 11:27:15 +0000 (11:27 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit e8d59ca3361bcdaf4db729eeb4a71f714bd9feda)

source4/librpc/rpc/dcerpc.c

index dafe1feb9a787da95c4d45ddece2fd4ccd546472..6600febf068feb4a5ad5168f72a9887aecc00f38 100644 (file)
@@ -1357,6 +1357,10 @@ static void dcerpc_bind_recv_handler(struct rpc_request *subreq,
        if (tevent_req_nterror(req, status)) {
                return;
        }
+       status = dcerpc_binding_set_abstract_syntax(b, &state->p->syntax);
+       if (tevent_req_nterror(req, status)) {
+               return;
+       }
 
        tevent_req_done(req);
 }
@@ -2307,6 +2311,7 @@ static void dcerpc_alter_context_recv_handler(struct rpc_request *subreq,
                struct dcerpc_alter_context_state);
        struct dcecli_connection *conn = state->p->conn;
        struct dcecli_security *sec = &conn->security_state;
+       struct dcerpc_binding *b = NULL;
        NTSTATUS status;
 
        /*
@@ -2384,6 +2389,15 @@ static void dcerpc_alter_context_recv_handler(struct rpc_request *subreq,
                }
        }
 
+       /*
+        * We're the owner of the binding, so we're allowed to modify it.
+        */
+       b = discard_const_p(struct dcerpc_binding, state->p->binding);
+       status = dcerpc_binding_set_abstract_syntax(b, &state->p->syntax);
+       if (tevent_req_nterror(req, status)) {
+               return;
+       }
+
        tevent_req_done(req);
 }