diff --git a/Dockerfile.agnos b/Dockerfile.agnos index 09d02f0..dbf6652 100644 --- a/Dockerfile.agnos +++ b/Dockerfile.agnos @@ -127,7 +127,6 @@ RUN cd /tmp && \ libpolkit-gobject-1-0 \ libsystemd0 \ polkitd \ - polkitd-pkla \ mobile-broadband-provider-info && \ apt-get -o Dpkg::Options::="--force-overwrite" install -yq ./libqmi.deb && \ apt-get -o Dpkg::Options::="--force-overwrite" install -yq ./modemmanager.deb && \ @@ -176,8 +175,7 @@ COPY ./userspace/firmware/* /lib/firmware/ # populate /etc COPY ./userspace/files/fstab /etc COPY ./userspace/files/profile /etc/profile -COPY ./userspace/files/allow-network-control.pkla /etc/polkit-1/localauthority/50-local.d/allow-network-control.pkla -COPY ./userspace/files/allow-modem-control.pkla /etc/polkit-1/localauthority/50-local.d/allow-modem-control.pkla +COPY ./userspace/files/comma-polkit.rules /etc/polkit-1/rules.d/ COPY ./userspace/files/*.rules /etc/udev/rules.d/ COPY ./userspace/files/ssh*_config /etc/ssh/ COPY ./userspace/files/logrotate.conf /etc/ diff --git a/userspace/files/allow-modem-control.pkla b/userspace/files/allow-modem-control.pkla deleted file mode 100644 index 3fa2e54..0000000 --- a/userspace/files/allow-modem-control.pkla +++ /dev/null @@ -1,4 +0,0 @@ -[Allow sudo users to control modem] -Identity=unix-group:sudo -Action=org.freedesktop.ModemManager1.* -ResultAny=yes diff --git a/userspace/files/allow-network-control.pkla b/userspace/files/allow-network-control.pkla deleted file mode 100644 index 7f364ce..0000000 --- a/userspace/files/allow-network-control.pkla +++ /dev/null @@ -1,4 +0,0 @@ -[Allow sudo users to control networking] -Identity=unix-group:sudo -Action=org.freedesktop.NetworkManager.* -ResultAny=yes diff --git a/userspace/files/comma-polkit.rules b/userspace/files/comma-polkit.rules new file mode 100644 index 0000000..e5b65b2 --- /dev/null +++ b/userspace/files/comma-polkit.rules @@ -0,0 +1,8 @@ +// Allow sudo users to control network & modem +polkit.addRule(function (action, subject) { + if ((action.id.startsWith("org.freedesktop.NetworkManager.") || + action.id.startsWith("org.freedesktop.ModemManager1.")) && + subject.isInGroup("sudo")) { + return polkit.Result.YES; + } +});