wireplumber 0.4.16

This commit is contained in:
Wim Taymans 2023-11-23 09:36:56 +01:00
parent f3af28bd7d
commit 970fce2ace
3 changed files with 6 additions and 73 deletions

View File

@ -1,69 +0,0 @@
From 7a65d76a57a5a656a5d9385b0144d15b376ddc7d Mon Sep 17 00:00:00 2001
From: James Calligeros <jcalligeros99@gmail.com>
Date: Sun, 29 Oct 2023 11:03:36 +1000
Subject: [PATCH] policy-dsp: add ability to hide parent nodes
some hardware devices are never supposed to be accessed directly by
clients, and are designed under the assumption that they will be
front-loaded by some sort of DSP. add a hide_parent property
to policy-dsp and revoke all permissions to the bound node of a DSP
graph where this is set to prevent hardware misuse or damage by poorly
behaved/configured clients.
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
---
src/scripts/policy-dsp.lua | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/src/scripts/policy-dsp.lua b/src/scripts/policy-dsp.lua
index 55f86c68d018..ce23a67afded 100644
--- a/src/scripts/policy-dsp.lua
+++ b/src/scripts/policy-dsp.lua
@@ -28,7 +28,12 @@ nodes_om = ObjectManager {
Interest { type = "node" },
}
+clients_om = ObjectManager {
+ Interest { type = "client" }
+}
+
filter_chains = {}
+hidden_nodes = {}
nodes_om:connect("object-added", function (om, node)
for _, r in ipairs(config.rules or {}) do
@@ -43,6 +48,17 @@ nodes_om:connect("object-added", function (om, node)
filter_chains[id] = LocalModule("libpipewire-module-filter-chain", r.filter_chain, {}, true)
end
end
+
+ if r.hide_parent then
+ Log.debug("Hiding node " .. node["bound-id"] .. " from clients")
+ for client in clients_om:iterate { type = "client" } do
+ if not client["properties"]["wireplumber.daemon"] then
+ client:update_permissions { [node["bound-id"]] = "-" }
+ end
+ end
+ hidden_nodes[node["bound-id"]] = id
+ end
+
end
end
end
@@ -58,4 +74,13 @@ nodes_om:connect("object-removed", function (om, node)
end
end)
+clients_om:connect("object-added", function (om, client)
+ for id, _ in pairs(hidden_nodes) do
+ if not client["properties"]["wireplumber.daemon"] then
+ client:update_permissions { [id] = "-" }
+ end
+ end
+end)
+
nodes_om:activate()
+clients_om:activate()
--
2.41.0

View File

@ -1 +1 @@
SHA512 (wireplumber-0.4.15.tar.bz2) = 53cf2027c69e8f44fc2c0c8910c1371ef8b5020aa1c47ca77f448998e810133821d9aa8de855482308b861f67b3d1cbd039c510460d59c6f9f2a44049577605b
SHA512 (wireplumber-0.4.16.tar.bz2) = 10bff323403f727b8653c8d287827e2c1e47913f2e3978d5f6e11fd29f30311fc1a11b4893073fa668a70d7dc115002822fa402f98e5b2d0e2eaa81145b727d8

View File

@ -1,6 +1,6 @@
Name: wireplumber
Version: 0.4.15
Release: 2%{?dist}
Version: 0.4.16
Release: 1%{?dist}
Summary: A modular session/policy manager for PipeWire
License: MIT
@ -8,7 +8,6 @@ URL: https://pipewire.pages.freedesktop.org/wireplumber/
Source0: https://gitlab.freedesktop.org/pipewire/%{name}/-/archive/%{version}/%{name}-%{version}.tar.bz2
## upstream patches
Patch0001: 0001-policy-dsp-add-ability-to-hide-parent-nodes.patch
## upstreamable patches
@ -120,6 +119,9 @@ fi
%{_datadir}/gir-1.0/Wp-0.4.gir
%changelog
* Thu Oct 12 2023 Wim Taymans <wtaymans@redhat.com> - 0.4.16-1
- wireplumber 0.4.16
* Tue Nov 7 2023 Hector Martin <marcan@fedoraproject.org> - 0.4.15-2
- Add upstream patch to enable node hiding