Bug 422030

Summary: Pkexec does not work with Dolphin service menus on 20.04
Product: [Applications] dolphin Reporter: Don B. Cilly <donbcilly>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: alexander.lohnau, kfm-devel, nate, sitter
Priority: NOR Keywords: regression
Version: 20.04.1   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Don B. Cilly 2020-05-24 19:56:43 UTC
SUMMARY
On Kubuntu 20.04, service menus requiring elevated privileges. No pkexec pop-up.
If I try pkexec <command> from konsole, it works. In a Dolphin service menu, it does not.

The same exact service menus work on neon 5.18 and and Kubuntu 18.04 and not on K20

STEPS TO REPRODUCE
1. Run a service menu that requires pkexec on Kubuntu 20.04
2. Run it on neon 5.18 or Kubuntu 18.04
3. 

OBSERVED RESULT
They don't work on K20. No password pop-up.

EXPECTED RESULT
They should :·)


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Kubuntu 20.04/5.18.5
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
I'm on neon ATM, I guess Qt and FW version not relevant, Plasma is the same on both, one works, the other doesn't.
Comment 1 Don B. Cilly 2020-05-24 20:00:36 UTC
100% of people who have tried it (3 of 3 :·) confirm it.
I tried it on TWO 20.04 machines.
Comment 2 Alexander Lohnau 2020-05-28 11:15:40 UTC
> 1. Run a service menu that requires pkexec on Kubuntu 20.04

Could you please give an example?
Comment 3 Don B. Cilly 2020-05-29 06:12:06 UTC
Sure. Take this simple service menu. It touches a file that requires elevated privileges as in the case it is, say, owned by root.

You run that on an 18.04-based system, it works.
You run it on 20.04, it doesn't.
The polkit window for the password does not come up.

[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
MimeType=all/all;
#MimeType=all;
Actions=stouch;
Encoding=UTF-8
Icon=application-x-cd-image

[Desktop Action stouch]
Name=Sudo touch
Icon=edit-redo
Exec=pkexec touch %f; kdialog --title="Touch" --passivepopup="Touched";fi
Comment 4 Nate Graham 2020-05-29 13:30:04 UTC
Does it work if you run that command by hand in a terminal window?
Comment 5 Don B. Cilly 2020-05-29 16:13:50 UTC
Yes. As I say in the OP,
>If I try pkexec <command> from konsole, it works. In a Dolphin service menu, it does not.

Pkexec also works from bash scripts. Only with Dolphin service menus it fails - on K20. Please try.
Comment 6 Nate Graham 2020-05-29 16:25:08 UTC
Thanks!
Comment 7 Don B. Cilly 2020-06-01 15:38:52 UTC
On further testing:
If I remove/comment-out the "; kdialog" bit, that is, if I only have the single
"Exec=pkexec touch %f" command, it works on 20.04.

Which is still buggy. I want the kdialog pop-up. It works on 18.04/neon.

So the issue seems to be multiple commands.
I tried "pkexec bash -c...", no luck.
Comment 8 Harald Sitter 2020-06-09 10:24:43 UTC
> Exec=pkexec touch %f; kdialog --title="Touch" --passivepopup="Touched";fi

That line is invalid. It has a trailing ;fi that means nothing
Comment 9 Don B. Cilly 2020-06-10 06:09:04 UTC
It means nothing. It works perfectly - on Neon/18.04.
Removing the ;fi makes it work on 20.04 too.

It was obviously a "leftover". And just as obviously, the fact that it *did* work on neon, made me overlook it. Sorry. Good job.