kdesu patch

Allan Sandfeld Jensen snowwolf at one2one-networks.com
Tue Jun 4 11:45:30 BST 2002


On Tuesday 04 June 2002 11:37, Stephan Kulow wrote:
> Hi!
>
> Some tools expect /sbin to be part of the root path as "su"
> adds them (I'm not sure if it's set by some environment files
> or if it's added by su itself - "su -" surely sets it through the
> profile)
>
> Anyway, kdesu doesn't behave like that, so /sbin is missing.
> Anyone objecting against the following patch?
>
> Greetings, Stephan
>
> +               if (!path.isEmpty())
> +                   path = "/sbin:/usr/sbin:" + path;
> +               else
> +                   path = "/sbin:/usr/sbin";

In case the path is empty shouldnt we use the full standard path and include 
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Also if you look at the environment after running su. It seems it does run 
profile it just doesnt clear the environment first:

Princess:/etc% echo $PATH
/opt/kde3/bin:/opt/qt3/bin:/usr/local/bin:/usr/bin:/usr/intel/ia32/bin:/bin:/usr/bin/X11:/usr/games
Princess:/etc% su
Password:
Princess:/etc# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin
Princess:/etc# exit




More information about the kde-core-devel mailing list