Finding kdesu binary

David Faure faure at kde.org
Sat Jan 30 10:51:55 UTC 2016


On Friday 29 January 2016 16:30:44 Luigi Toscano wrote:
> On Friday 29 of January 2016 16:13:55 Aleix Pol wrote:
> > On Fri, Jan 29, 2016 at 3:33 PM, Andrius Štikonas <andrius at stikonas.eu> 
> wrote:
> > > Hi,
> > > 
> > > I would like to ask how do I find kdesu binary from the code (of
> > > partitionmanager).
> > > 
> > > PartitionManager tries to restart itself with root privileges and tries to
> > > rerun itself with kdesu, kdesudo or gksu... However, KF5 based kdesu is
> > > now in libexec, something like
> > > /usr/lib64/libexec/kf5/kdesu
> > > but it varies from distribution to distribution and not in $PATH.
> > > 
> > > Is there a way to find the location in the cross-platform way? There is
> > > kf5-config --path libexec but it is from kdelibs4support and it's better
> > > not to depend on kdelibs4support.
> > 
> > If I understand correctly, you should use the KSu framework for that.
> > kdesu is not public API, that's why it's in libexec.
> 
> Is there a reason for that? I understand that we are trying to push people to 
> use policykit and proper privilege request, but (unfortunately) there are 
> applications that could be run as root from time to time.
> 
> Having it in PATH (which some distribution do) allows to do 
> ALT-F2-> kdesu <app>

Since (IIRC) the main reason for moving kdesu to libexec was to avoid
a clash with the KDE4 kdesu, I see no reason against installing a kdesu5
script in PREFIX/bin which contains:

#!/bin/sh
exec /full/path/to/libexec/kdesu

(using configure_file to expand the path during cmake time)

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list