community/modemmanager: fix polkit rules for GeoClue integration

Current polkit rules block GeoClue from interacting with ModemManager when a location request is received by GeoClue. Allow GeoClue to use the org.freedesktop.ModemManager1.Device.Control and org.freedesktop.ModemManager1.Location DBus APIs
This commit is contained in:
Dylan Van Assche 2021-04-05 18:41:08 +02:00 committed by Leo
parent d23b02bcd7
commit ca28e4dedb
2 changed files with 10 additions and 2 deletions

View File

@ -2,7 +2,7 @@
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=modemmanager
pkgver=1.16.2
pkgrel=2
pkgrel=3
pkgdesc="ModemManager library"
url="http://www.freedesktop.org/wiki/Software/ModemManager"
arch="all !mips !mips64 !s390x" # polkit
@ -78,5 +78,5 @@ check() {
}
sha512sums="c0b095972eba6e0f3a1ad22e425b412f17d8b60f0af4d423a92fdebcb6d2801f87e6af98758f8c2dc4db3586a3a15530a318805fda312443fa6abe2265ebd6b6 ModemManager-1.16.2.tar.xz
8d736f477649e42c05b34ac55391353c7f0c17138d039e049b16b07624d86fd9968ef1aa14672a63decf8b2c0ae984a34a0770322198b326775efba58f566685 modemmanager.rules
6fab86c27502b29be0c6610d835a3249a4a81993eb986cff2c3ea9393fadd3f693ba4bb0532ae0e50a83d359559511859dd05f7ea2f0cb52839f535a7e49f8a0 modemmanager.rules
9f74a2473b9cc7be42a467809639f5720ab251d13f29f8bbd4fd9a13edb80c10c5ee50fbe50819bfe67f231805b92f007c3e7403c46ab998dc843e1f9549659b modemmanager.initd"

View File

@ -9,3 +9,11 @@ polkit.addRule(function(action, subject) {
}
});
// Let geoclue modify ModemManager for location gathering
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.ModemManager1.Device.Control" ||
action.id == "org.freedesktop.ModemManager1.Location") &&
subject.isInGroup("geoclue")) {
return "yes";
}
});