Bug 397542 - partitionmanager on Wayland cannot obtain root privileges (kdesu)
Summary: partitionmanager on Wayland cannot obtain root privileges (kdesu)
Status: RESOLVED FIXED
Alias: None
Product: partitionmanager
Classification: Applications
Component: general (other bugs)
Version First Reported In: 3.3
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Andrius Štikonas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-17 09:22 UTC by Mark
Modified: 2018-08-17 18:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 4.0
Sentry Crash Report:


Attachments
GUI command asking for password to sudo, then fails silently (30.71 KB, image/png)
2018-08-17 13:39 UTC, Mark
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark 2018-08-17 09:22:07 UTC
possible related packages: kdesu from kf5; wayland; gparted

Bug: partitionmanager is unusable on Wayland, as obtaining required root privileges fails. 

Steps to reproduce: 
login to wayland session, start partitionmanager, you get asked for password (kdesu & PAM?), but then the authentication fails (correct password). 

Under X session, the same works OK. 

gparted has the same problem. 

For example NetworkManager & kwallet authentication requests under wayland work. 

Thank you,
Comment 1 Alexander Mentyu 2018-08-17 13:04:31 UTC
Partition Manager and GParted are launching ok after password enter - both from App Menu and from Konsole (partitionmanager and gparted-pkexec). @Mark can you please add more info about your system?

Distribution: KDE neon Developer Edition
Kernel: 4.15.0-29-generic
Plasma: 5.13.80
Apps: 18.11.70
Qt: 5.11.1
Frameworks: 5.48.0
Graphics:
Card-1: Intel Device 5917
Card-2: NVIDIA GM108M [GeForce 940MX]
Display Server: X.Org 1.19.6 drivers: (unloaded: fbdev,vesa) FAILED: nouveau
Resolution: 1920x1080@57.25hz
GLX Renderer: Mesa DRI Intel UHD Graphics 620 (Kabylake GT2) GLX Version: 3.0 Mesa 18.0.5
Comment 2 Mark 2018-08-17 13:37:29 UTC
Thanks for your testing, Alexander. From your description it seems you're running a normal X session, right? As the bug states, this is a problem only on wayland (in sddm choose Plasma (Wayland) session).
Comment 3 Mark 2018-08-17 13:39:01 UTC
Created attachment 114464 [details]
GUI command asking for password to sudo, then fails silently
Comment 4 Mark 2018-08-17 13:41:35 UTC
Did some more testing, might be bug of kdesu, not partitionmanager ?

$ ls -ld `which kdesu`
lrwxrwxrwx 1 root root 43 srp 12 17:42 /usr/sbin/kdesu -> /usr/lib/x86_64-linux-gnu/libexec/kf5/kdesu

$ kdesu kate
QSocketNotifier: Can only be used with threads started with QThread
org.kde.kdesu: Daemon not safe (not sgid), not using it.

Using Wayland-EGL
Using the 'xdg-shell-v6' shell integration
Comment 5 Andrius Štikonas 2018-08-17 17:52:55 UTC
It worked for me last time I tried 3.3 (and I use wayland).
Maybe you were trying to run it under XWayland, not wayland?

In that case you can try "xhost +", it helps with GParted too but
note that there are security implications.

Anyway, current git no longer uses kdesu, so this would be fixed anyway,
you can already try it in neon bionic dev editions.

NetworkManager and kwallet are unrelated...
Kwallet just uses application password.

Networkmanager uses polkit which is the method used in partitionmanager git
(GUI runs as unprivileged user and executes non-GUI helpers as root). Although, to be able to use kauth/polkit we had to use it in a bit naughty way... So I am still harderning KAuth helper a bit...

kdesu works with kate. It's just kate that doesn't allow running as root. In general you shouldn't run any GUI apps as root. kate even prints a warning if you run it with kdesu -t kate
Comment 6 Mark 2018-08-17 18:13:05 UTC
Hi Andrius, 

great to see KDE Neon /dev is a step head in fixing bugs ;) I'll just wait for this to hit /user. 

> GUI runs as unprivileged user and executes non-GUI helpers as root). Although, to be able to use kauth/polkit we had to use it in a bit naughty way... So I am still harderning KAuth helper a bit...

Perfect, this is the proper approach. Some GUI apps just execute all the GUI as root, which is prone to troubles. 

Thank you for your great work! 
Cheers,
Comment 7 Andrius Štikonas 2018-08-17 18:24:58 UTC
(In reply to Mark from comment #6)
> Hi Andrius, 
> 
> great to see KDE Neon /dev is a step head in fixing bugs ;) I'll just wait
> for this to hit /user. 
> 

It will take a while... We at least need to wait till smartmontools 6.7 is released, which I don't think will happen in 2018...