From ab0a06e0c34f49234ff93b184e3a836b3706dcbe Mon Sep 17 00:00:00 2001 From: mirkobrombin Date: Wed, 3 Jan 2024 00:02:07 +0100 Subject: [PATCH] feat[close #33]: Add polkit rules for Apx (dbox and podman) --- .../polkit-1/actions/org.vanillaos.vso.policy | 25 +++++++++++++++++-- .../polkit-1/rules.d/org.vanillaos.vso.rules | 6 ++++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/includes.container/usr/share/polkit-1/actions/org.vanillaos.vso.policy b/includes.container/usr/share/polkit-1/actions/org.vanillaos.vso.policy index 7859b39..0ce9ea3 100644 --- a/includes.container/usr/share/polkit-1/actions/org.vanillaos.vso.policy +++ b/includes.container/usr/share/polkit-1/actions/org.vanillaos.vso.policy @@ -6,7 +6,6 @@ Vanilla OS https://www.vanillaos.org/ package-x-generic - Check for system package updates Authentication is required to check for updates @@ -19,4 +18,26 @@ /usr/bin/vso sys-upgrade - + + Manager privileged containers + Authentication is required to manage privileged containers + package-x-generic + + auth_admin + auth_admin + auth_admin_keep + + /usr/share/apx/distrobox/distrobox + + + Manager privileged containers + Authentication is required to manage privileged containers + package-x-generic + + auth_admin + auth_admin + auth_admin_keep + + /usr/bin/podman + + \ No newline at end of file diff --git a/includes.container/usr/share/polkit-1/rules.d/org.vanillaos.vso.rules b/includes.container/usr/share/polkit-1/rules.d/org.vanillaos.vso.rules index 6b94c5b..259dc74 100644 --- a/includes.container/usr/share/polkit-1/rules.d/org.vanillaos.vso.rules +++ b/includes.container/usr/share/polkit-1/rules.d/org.vanillaos.vso.rules @@ -1,6 +1,10 @@ polkit.addRule(function (action, subject) { if ( - action.id == "org.vanillaos.vso.sys-upgrade" && + ( + action.id == "org.vanillaos.vso.sys-upgrade" || + action.id == "org.vanillaos.vso.distrobox" || + action.id == "org.vanillaos.vso.podman" + ) && subject.isInGroup("sudo") ) { polkit.log("action=" + action);