[neon/neon-packaging/kwin-selenium-tester/Neon/unstable] debian: fix setcap stuffs

Carlos De Maine null at kde.org
Mon Sep 30 06:18:34 BST 2024


Git commit 04560528e013e94ebac968e7e7bd96f114d67265 by Carlos De Maine.
Committed on 30/09/2024 at 05:18.
Pushed by carlosdem into branch 'Neon/unstable'.

fix setcap stuffs

M  +8    -4    debian/kwin-selenium-tester.postinst

https://invent.kde.org/neon/neon-packaging/kwin-selenium-tester/-/commit/04560528e013e94ebac968e7e7bd96f114d67265

diff --git a/debian/kwin-selenium-tester.postinst b/debian/kwin-selenium-tester.postinst
index 1eb831b..66d832e 100644
--- a/debian/kwin-selenium-tester.postinst
+++ b/debian/kwin-selenium-tester.postinst
@@ -7,16 +7,20 @@ if [ "$1" = configure ]; then
     # 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="/opt/kwin-selenium-tester/bin/kwin_wayland"
+
     if command -v setcap > /dev/null; then
         cap="CAP_SYS_NICE=+ep"
-        if setcap $cap $path; then
+        path="/opt/kwin-selenium-tester/bin/kwin_wayland"
+         if setcap $cap $path; then
             echo "Setcap worked for $path!"
         else
-            echo "Setcap failed for $path"
+            echo "Setcap failed for $path, falling back to setuid" >&2
+            chmod u+s $path
         fi
     else
-        echo "Setcap is not installed, failed to setcap on $path" >&2
+        echo "Setcap is not installed, falling back to setuid for $path" >&2
+        chmod u+s $path
+
     fi
 fi
 


More information about the Neon-commits mailing list