Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

policykit issue for Geoclue and ModemManager #118

Open
Baggypants opened this issue Oct 25, 2021 · 6 comments
Open

policykit issue for Geoclue and ModemManager #118

Baggypants opened this issue Oct 25, 2021 · 6 comments

Comments

@Baggypants
Copy link

Looking at the output of journalctl -flu geoclue restarting geoclue and then starting Gnome Maps shows this

Oct 25 15:47:51 fedora geoclue[27831]: Failed to set GPS refresh rate: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unauthorized: PolicyKit authorization failed: not authorized for 'org.freedesktop.ModemManager1.Device.Control'
Oct 25 15:47:51 fedora geoclue[27831]: Failed to enable GPS: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unauthorized: PolicyKit authorization failed: not authorized for 'org.freedesktop.ModemManager1.Device.Control'
Oct 25 15:47:51 fedora geoclue[27831]: Failed to enable 3GPP: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unauthorized: PolicyKit authorization failed: not authorized for 'org.freedesktop.ModemManager1.Device.Control'

Looks like geoclue can't access the modem location stuff because of a policykit issue.

@Baggypants
Copy link
Author

The rule in here seemed to fix it

https://githubmemory.com/repo/dreemurrs-embedded/Pine64-Arch/issues/212

polkit.addRule(function(action, subject) {
  if(action.id.startsWith("org.freedesktop.ModemManager1") && subject.user == "geoclue") {
    polkit.log(action.id);
    return polkit.Result.YES;
  }
});

There seemed a concern about it being a good rule though.

@Torbuntu
Copy link
Collaborator

Is that not something that gets resolved after this: https://gitlab.freedesktop.org/geoclue/geoclue/-/commit/a9aea6a4948e2ff9ec5ff066cf20dac069c0d3a0 ?

@Baggypants
Copy link
Author

Baggypants commented Oct 25, 2021

No, that's to do with phosh acting as an agent for applications wanting to access geoclue. Not geoclue accessing location sources, such as the EG25.

@Baggypants
Copy link
Author

Marius found a better rule

https://www.apt-browse.org/browse/ubuntu/xenial/universe/amd64/geoclue-2.0/2.4.1-1/file/usr/share/polkit-1/rules.d/geoclue-2.0.rules

polkit.addRule(function(action, subject) {
    if ((action.id == "org.freedesktop.ModemManager1.Device.Control" ||
         action.id == "org.freedesktop.ModemManager1.Location") &&
        subject.user == "geoclue") {
        return polkit.Result.YES;
    }
});

@Cyborgscode
Copy link

geoclue maintainer has been contacted to add it to geoclue2 package.

@alvaropg
Copy link

Contributed to that part: https://gitlab.freedesktop.org/geoclue/geoclue/-/merge_requests/102

So it's going to be included in next geoclue2 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants