| Summary: | device notifier not mounting device: problem with polkit | ||
|---|---|---|---|
| Product: | [Plasma] plasmashell | Reporter: | Olivier Carton <olivier.carton.kde> |
| Component: | Disks & Devices widget | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | kde, nate |
| Priority: | NOR | ||
| Version First Reported In: | 5.9.4 | ||
| Target Milestone: | 1.0 | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 5.20 | |
| Sentry Crash Report: | |||
|
Description
Olivier Carton
2017-03-31 17:14:59 UTC
Thanks for your analysis, unfortunately I can't see an obvious reason why the two methods result in different PolicyKit calls.
The "mount" button ends up doing the following:
if (device.is<Solid::StorageAccess>()) {
Solid::StorageAccess *access = device.as<Solid::StorageAccess>();
if (access && !access->isAccessible()) {
access->setup();
}
}
Whereas triggering an action before executing it does the following:
if (device.is<Solid::StorageAccess>()
&& !device.as<Solid::StorageAccess>()->isAccessible()) {
Solid::StorageAccess *access = device.as<Solid::StorageAccess>();
connect(access, &Solid::StorageAccess::setupDone,
this, &DelayedExecutor::_k_storageSetupDone);
access->setup();
With _k_storageSetupDone being called once the device is mounted and then the action is executed. Also, "setup" just asks UDisks on DBus to mount the given device which then does PolicyKit authentication - that's not somthing we do on our side.
Thank you for taking care of it.
Here are some more information. If I try to mount using udisk
directly with something like "udisksctl mount -b /dev/sdb1", it
works.
If I add a file /etc/polkit-1/rules.d/10-udisks.rules containing
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.udisks2.filesystem-mount" && subject.isInGroup("plugdev")) {
return "yes";
}
});
it solves the problem. This means by the way that the bug is not
so annoying but it also shows that the problem comes really from
the interaction with polkit. From what you say, this interaction
is done by udisk. Is udisk "called" in the way in both scenarios ?
However, this trick does not solve the second problem I mentioned. Dolphin
still does not start.
This is fixed in the 5.20 UI overhaul. |