In the wake of kdesudo
's demise, I'm trying to replace it using sudo -A
and a very simple helper script which calls kdialog --password
based on an answer I got here.
I need this for use with bash
scripts which may be invoked from a GUI where there is no terminal for normal command line i/o.
This has some nice options and works fine with one problem:
The dialog displayed by kdialog
has OK
and Cancel
buttons.
If I change my mind and decide not to proceed, then selecting Cancel
, pressing Esc
, or just clicking on the X in the dialog window frame causes the dialog to be presented twice more (just like entering the wrong password would).
I haven't checked, but I bet it's logging three failed password attempts to my security log too when all I'm trying to do is quit the command.
Is there a way to tell it that I want to quit now?
Is this a bug in kdialog
or sudo
?
I'm running
kubuntu 18.04
KDE Frameworks 5.44.0
Qt 5.9.5 (built against 5.9.5)
The xcb windowing system
GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)
I have looked at pkexec
and don't want to deal with defining policies in XML. And it presents a huge, ugly dialog window that I really don't want to look at.
Also, I have scripts that need to run several elevated commands and if I don't run the whole script elevated (which I don't want to do), then I have to enter my password several times to do one task.
There's still a version of kdesu
available, but it looks like that may go away too.
I also learned about using the admin://
prefix for a file argument in a command, but some commands I need to elevate don't have any file arguments to apply it to.
pkexec
solve your problem? – Jeremy Aug 25 '18 at 09:07