[neon/kde/ksystemstats/Neon/unstable] debian: add setcap bits for ksystemstats_xe_helper
Carlos De Maine
null at kde.org
Mon May 25 09:15:36 BST 2026
Git commit 9513c6269b78d9b1e0590d4beb460eff9dbe2327 by Carlos De Maine.
Committed on 25/05/2026 at 08:15.
Pushed by carlosdem into branch 'Neon/unstable'.
add setcap bits for ksystemstats_xe_helper
M +19 -0 debian/ksystemstats.postinst.in
M +2 -1 debian/setcap.yaml
https://invent.kde.org/neon/kde/ksystemstats/-/commit/9513c6269b78d9b1e0590d4beb460eff9dbe2327
diff --git a/debian/ksystemstats.postinst.in b/debian/ksystemstats.postinst.in
index f45728c..4dfe4cf 100755
--- a/debian/ksystemstats.postinst.in
+++ b/debian/ksystemstats.postinst.in
@@ -20,4 +20,23 @@ if [ "$1" = configure ]; then
fi
fi
+
+if [ "$1" = configure ]; then
+ # Try to setcap or fall back to setuid.
+ # The specific setcap invocations also need to be whitelisted to make the
+ # build pass (in debian/setcap.yaml as a nested array of argument
+ # arrays).
+ path="/usr/lib/@DEB_HOST_MULTIARCH@/libexec/ksystemstats_xe_helper"
+ if command -v setcap > /dev/null; then
+ cap="CAP_PERFMON=+ep"
+ if setcap $cap $path; then
+ echo "Setcap worked for $path!"
+ else
+ echo "Setcap failed for $path"
+ fi
+ else
+ echo "Setcap is not installed, failed to setcap on $path" >&2
+ fi
+fi
+
exit 0
diff --git a/debian/setcap.yaml b/debian/setcap.yaml
index 02d3e4a..b9746da 100644
--- a/debian/setcap.yaml
+++ b/debian/setcap.yaml
@@ -2,4 +2,5 @@
# Being whitelisted means they will pass the build without problems.
# A whitelisted call needs to have a corresponding setcap/setuid call in
# postinst so it actually gets applied.
-- ["CAP_PERFMON=+ep", "*/usr/lib/*/libexec/ksystemstats_intel_helper"]
\ No newline at end of file
+- ["CAP_PERFMON=+ep", "*/usr/lib/*/libexec/ksystemstats_intel_helper"]
+- ["CAP_PERFMON=+ep", "*/usr/lib/*/libexec/ksystemstats_xe_helper"]
More information about the Neon-commits
mailing list