kdesu - console output and password keeping
- Date: Thu, 18 Jan 2018 10:44:04 +0100
- From: Milian Wolff <mail@xxxxxxxxxx>
- Subject: kdesu - console output and password keeping
We've recently integrated kdesu into hotspot  to be able to record profile
data as root. This is required to get access to some "advanced" performance
counters and trace points, most notably the sched:sched_switch tracepoint
required for off-CPU profiling.
Now, my colleague originally used kdesudo which doesn't seem to be alive (?)
upstream. I've seen there's some bzr repo that the kubuntu people seem to use.
But in KDE proper, only kdesu is available. So I used that instead but it has
a severe limitation: I cannot show the command output _and_ enable password
$ man kdesu
Enable terminal output. This disables password keeping. This is
largely for debugging purposes; if you want to run a console mode app, use the
standard su instead.
I don't quite get why one would want to use standard su - we want to show a
graphical dialog to the user and enable password keeping. Can someone explain
this limitation? Is there some other alternative we could use? Essentially we
run the following command right now, which shows what we need to do:
kdesu -u root -t --attach $winId -- \
perf record -o $outputfile <...more args...> -- \
runuser -u $non-root-user -- \
kdesu -u root -t --attach $winId --
chown $non-root-user:$non-root-group $outputfile
This triggers two password prompts, which is unfortunate I think.