You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Authentication is required to install ostree-metadata from flathub #2328
Is this popping up because gnome-software is downloading the metadata in the background?
Should gnome-software do something differently? Like, check that it has permissions to download metadata with g_permission_get_allowed() and if not, not do automatic updates?
Automatic updates can only work if all the involved steps don't require authentication.
We may need some api to query this, or some flag to indicate it
For the record this turned out to be caused by /usr/share/polkit-1/rules.d/org.freedesktop.Flatpak.rules having subject.isInGroup("wheel") rather than subject.isInGroup("sudo"), which presumably was caused by me compiling flatpak incorrectly. The above commit just moves the operation to a different polkit action but isn't strictly necessary if the default set of policy and rules are being used.
Fair enough, but how about regular users who aren't in wheel/sudo? Should gnome-software do something differently there to not spam them with metadata updating polkit prompts?
@kalev if we want to support some sort of locked-down use case where the system installation is entirely readonly for users, then yes, g-s should not trigger those dialogs for background operations. Maybe this can be done by providing some 'allow-interactive' or 'background' flag to the system helper. I think we've done this sort of hint in other places before ?
I'm thinking that polkit prompts popping up out of nowhere is bad user experience regardless of whether it's a locked down account or a regular user.
Maybe gnome-software should just skip doing background updates if it can't do it without acquiring polkit permissions? I think it's already possible to check this with g_permission_get_allowed() without adding new API.
packagekit has a "background" concept, but there "background" means something else, that the background tasks get cancelled as soon as a non-background (user initiated) task comes in.
This adds a 'no-interaction' flag to FlatpakInstallation and FlatpakTransaction, and passes it through to the system helper (as far as possible, some methods unfortunately don't take flags).
With this, gnome-software can just set no-interaction when doing background tasks, and quietly handle a NOT_ALLOWED error (need to double-check exactly what error you'll get).
Is there a way for gnome-software to tell if something got skipped due to no_interaction? Would it be possible to have a new error code, so that gnome-software knows that the operation didn't go through due to no_interaction?
Looking at the code, the system-helper returns GIO_DBUS_ERROR_ACCESS_DENIED in this case (the same as if the user mistyped his password), which should bubble up all the way.
That should work. Right now gnome-software shows a helpful "Unable to download updates: you do not have permission to install software" when it gets that error, but I think we can improve on that and just ignore it :)
Quitly accepting defeat would be the right thing to do, in the no-interaction case. I can add getters for the no-interaction flag on the transaction and installation objects, if that makes it easier to differentiate.
Yeah, maybe that would be good if it's easy to do. I think gnome-software can handle keeping the no-interaction state on its own too, but it's possible it makes it easier in certain places, and it sounds like an easy thing to expose in libflatpak.
The PR now has flatpak_installation_[sg]et_no_interaction. I decided that we can do without a setter in the transaction, since you can just operate on the underlying installation.
I don't get the reasoning here, if we just make these noninteractive but don't change the PolKit logic / make a different action / something, we're "downgrading" the upgrade privelege to be basically useless unless you have the install privelege, because any upgrade op will also need to install metadata, and potentially new runtimes. That's inconsistent with our current defaults (non-priveleged users can upgrade but not install) and renders the two verbs useless/indivisible. So these changes are good (the noninteractive stuff) but we have more underlying issues to tackle:
I think we need to have a different (more permissable) action that covers metadata updates - moving it to "modify-repo" makes it worse because it's easy to imagine a system where the admin wants to control the remotes but is happy to allow users to install or upgrade from those remotes. Defining/modifying repos is "more priveleged" than install, not less.
We need to be able to figure out how to apply the upgrade perms to an install op that takes place as a part of an upgrade transaction.
(if upgrading is our "least priveleged" op we could attach all metadata fetches/updates to that)
the desired experience for background operations is that they happen in the background, without interrupting the user
if the polkit policy does not let us implement that (by insisting on interaction), we can't do background operations, so we don't
you're right that we should work on the policy to make them possible.
but currently, the operations arrive at the system-helper one-by-one, there's nothing to differentiate a install-due-to-an-update from an install-at-will.
I think we need to have a different (more permissable) action that covers metadata updates - moving it to "modify-repo" makes it worse because it's easy to imagine a system where the admin wants to control the remotes but is happy to allow users to install or upgrade from those remotes. Defining/modifying repos is "more priveleged" than install, not less.
modify-repo is not the action used for adding new remotes or modifying existing ones. That happens under configure-remote.
Activity
matthiasclasen commentedon Nov 16, 2018
Ha! Putting the details in the ui reveals the nonsense
kalev commentedon Nov 23, 2018
Is this popping up because gnome-software is downloading the metadata in the background?
Should gnome-software do something differently? Like, check that it has permissions to download metadata with g_permission_get_allowed() and if not, not do automatic updates?
matthiasclasen commentedon Nov 23, 2018
Automatic updates can only work if all the involved steps don't require authentication.
We may need some api to query this, or some flag to indicate it
system-helper: Don't require user auth for metadata pulls
system-helper: Use modify-repo action for metadata updates
system-helper: Use modify-repo action for metadata updates
mwleeds commentedon Nov 30, 2018
For the record this turned out to be caused by
/usr/share/polkit-1/rules.d/org.freedesktop.Flatpak.ruleshavingsubject.isInGroup("wheel")rather thansubject.isInGroup("sudo"), which presumably was caused by me compiling flatpak incorrectly. The above commit just moves the operation to a different polkit action but isn't strictly necessary if the default set of policy and rules are being used.kalev commentedon Dec 1, 2018
Fair enough, but how about regular users who aren't in wheel/sudo? Should gnome-software do something differently there to not spam them with metadata updating polkit prompts?
matthiasclasen commentedon Dec 1, 2018
@kalev if we want to support some sort of locked-down use case where the system installation is entirely readonly for users, then yes, g-s should not trigger those dialogs for background operations. Maybe this can be done by providing some 'allow-interactive' or 'background' flag to the system helper. I think we've done this sort of hint in other places before ?
kalev commentedon Dec 1, 2018
I'm thinking that polkit prompts popping up out of nowhere is bad user experience regardless of whether it's a locked down account or a regular user.
Maybe gnome-software should just skip doing background updates if it can't do it without acquiring polkit permissions? I think it's already possible to check this with g_permission_get_allowed() without adding new API.
packagekit has a "background" concept, but there "background" means something else, that the background tasks get cancelled as soon as a non-background (user initiated) task comes in.
matthiasclasen commentedon Dec 1, 2018
See #2367
This adds a 'no-interaction' flag to FlatpakInstallation and FlatpakTransaction, and passes it through to the system helper (as far as possible, some methods unfortunately don't take flags).
With this, gnome-software can just set no-interaction when doing background tasks, and quietly handle a NOT_ALLOWED error (need to double-check exactly what error you'll get).
kalev commentedon Dec 1, 2018
Ooh, awesome!
matthiasclasen commentedon Dec 1, 2018
some open questions:
matthiasclasen commentedon Dec 2, 2018
I answered the first question myself, by renaming it all to no_interaction, and I made a separate PR for adding flags
kalev commentedon Dec 3, 2018
no_interaction sounds great to me!
Is there a way for gnome-software to tell if something got skipped due to no_interaction? Would it be possible to have a new error code, so that gnome-software knows that the operation didn't go through due to no_interaction?
matthiasclasen commentedon Dec 3, 2018
Looking at the code, the system-helper returns GIO_DBUS_ERROR_ACCESS_DENIED in this case (the same as if the user mistyped his password), which should bubble up all the way.
kalev commentedon Dec 3, 2018
That should work. Right now gnome-software shows a helpful "Unable to download updates: you do not have permission to install software" when it gets that error, but I think we can improve on that and just ignore it :)
matthiasclasen commentedon Dec 3, 2018
Quitly accepting defeat would be the right thing to do, in the no-interaction case. I can add getters for the no-interaction flag on the transaction and installation objects, if that makes it easier to differentiate.
kalev commentedon Dec 3, 2018
Yeah, maybe that would be good if it's easy to do. I think gnome-software can handle keeping the no-interaction state on its own too, but it's possible it makes it easier in certain places, and it sounds like an easy thing to expose in libflatpak.
matthiasclasen commentedon Dec 3, 2018
The PR now has flatpak_installation_[sg]et_no_interaction. I decided that we can do without a setter in the transaction, since you can just operate on the underlying installation.
ramcq commentedon Dec 4, 2018
I don't get the reasoning here, if we just make these noninteractive but don't change the PolKit logic / make a different action / something, we're "downgrading" the upgrade privelege to be basically useless unless you have the install privelege, because any upgrade op will also need to install metadata, and potentially new runtimes. That's inconsistent with our current defaults (non-priveleged users can upgrade but not install) and renders the two verbs useless/indivisible. So these changes are good (the noninteractive stuff) but we have more underlying issues to tackle:
(if upgrading is our "least priveleged" op we could attach all metadata fetches/updates to that)
matthiasclasen commentedon Dec 4, 2018
basically, the reasoning is:
you're right that we should work on the policy to make them possible.
but currently, the operations arrive at the system-helper one-by-one, there's nothing to differentiate a install-due-to-an-update from an install-at-will.
matthiasclasen commentedon Dec 4, 2018
I agree with this. So here are some suggestions:
matthiasclasen commentedon Dec 4, 2018
See #2383 for these changes
mwleeds commentedon Dec 4, 2018
modify-repois not the action used for adding new remotes or modifying existing ones. That happens underconfigure-remote.matthiasclasen commentedon Dec 4, 2018
And see #2384 for another batch of polkit changes that gets us to the ideal of '1 transaction, (at most) 1 dialog'
kalev commentedon Dec 4, 2018
Awesome stuff :)