s3-iremotewinspool: check for correct object_uuid in dispatch fn.
authorGünther Deschner <gd@samba.org>
Mon, 25 Sep 2023 18:31:24 +0000 (20:31 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 13 Oct 2023 02:18:31 +0000 (02:18 +0000)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpc_server/spoolss/srv_iremotewinspool.c

index fb60dfef8224ceedf579547e5ec0d268d8d26d65..5bc4228f83f629fe0e886df6f1d3c1761a919a3b 100644 (file)
@@ -91,6 +91,25 @@ static NTSTATUS iremotewinspool__op_dispatch_internal(struct dcesrv_call_state *
        struct pipes_struct *p = NULL;
        NTSTATUS status = NT_STATUS_OK;
        bool impersonated = false;
+       bool ok;
+       struct GUID object_uuid;
+
+       ok = dce_call->pkt.pfc_flags & DCERPC_PFC_FLAG_OBJECT_UUID;
+       if (!ok) {
+               dce_call->fault_code = DCERPC_NCA_S_UNSUPPORTED_TYPE;
+               return NT_STATUS_NET_WRITE_FAULT;
+       }
+
+       status = GUID_from_string(IREMOTEWINSPOOL_OBJECT_GUID, &object_uuid);
+       if (!NT_STATUS_IS_OK(status)) {
+               dce_call->fault_code = DCERPC_NCA_S_UNSUPPORTED_TYPE;
+               return NT_STATUS_NET_WRITE_FAULT;
+       }
+
+       if (!GUID_equal(&dce_call->pkt.u.request.object.object, &object_uuid)) {
+               dce_call->fault_code = DCERPC_NCA_S_UNSUPPORTED_TYPE;
+               return NT_STATUS_NET_WRITE_FAULT;
+       }
 
        if (forward_opnum_to_spoolss(opnum)) {
                return spoolss__op_dispatch(dce_call, mem_ctx, r);