KDEROOTHOME set incorrectly; user settings ignored

Bug #44920 reported by Mark Lord
12
Affects Status Importance Assigned to Milestone
kdebase (Ubuntu)
Fix Released
Medium
Kubuntu Bugs

Bug Description

Binary package hint: ksmserver

The KDEROOTHOME environment variable is incorrectly set to "/root" when logging in as superuser. It should be "/root/.kde" instead. This results in the "System Settings" changes being ignored, and the KDE Control Center stores changes in the wrong directories. A bit of a mess, really.

To fix it, /usr/bin/startkde should be setting a default KDEROOTHOME variable for the root user. This can be done in /usr/bin/startkde, by adding one line just after where "kdehome" is set:

 kdehome=$HOME/.kde
 test -n "$KDEHOME" && kdehome=`echo "$KDEHOME"|sed "s,^~/,$HOME/,"`
+[ -z "$KDEROOTHOME" -a "$UID" == "0" ] && export KDEROOTHOME=$kdehome

Revision history for this message
Mark Lord (launchpad-rtr) wrote : Patch to fix /usr/bin/startkde

This fixes the problem, without creating any new problems.

Revision history for this message
Mark Lord (launchpad-rtr) wrote :

Problem present in KDE-3.5.2, on both Dapper and Breezy.

Revision history for this message
Didier Raboud (odyx) wrote :

Does this happen when you log in as root or when you use sudo/kdesu ?

Revision history for this message
Frode M. Døving (frode) wrote :

Cut&Paste from irclogs:
< yogi> Pardon me... has anyone noticed that the 'share' dir which belongs in /root/.kde is suddenly in /root??
< Riddell> yogi: that's deliberate, otherwise we end up with files in ~ that are owned by root and users can't write to them

Changed in kdebase:
assignee: nobody → kubuntu-team
Revision history for this message
Jonathan Riddell (jr) wrote :

It's caused by kubuntu_28_fix_sudo.diff in kdelibs which sets KDEROOTHOME to /root if the user id is 0. Is there any reference for what KDEROOTHOME should be set to? I remember looking it up at the time and must have found it should be /root but I could well have made a mistake.

Revision history for this message
Frode M. Døving (frode) wrote :

I think KDEROOTHOME should be ~/.kde
For that to work with sudo it should be set to /root/.kde/ for root. Don't you think?

Revision history for this message
Boudewijn (b-o-kubuntu-org) wrote :

L.S.

The patch proposed above fixes the problem, with one minor exception: A directory tree "share/config/" is still created under "/root/". In the beginning this "share/config/" contained a file kickerrc, but after having deleted this tree I have not seen it back. The final fix to the problem should also prevent the "share/config/" tree to be created.

    Best regards,
    Boudewijn

Revision history for this message
Boudewijn (b-o-kubuntu-org) wrote :

Hi Johnathan,

I found the answer your question on what KDEROOTHOME should be here:

<http://www.kde.org/areas/sysadmin/fsh.php>

I founc additional information in chapter 24 of the KDE User Guide of my openSUSE 10.1 installation:

---------
KDE Internals
Specifying Directories

Environment Variable: KDEHOME
Example Setting(s): ~/.kde
Comment:

Environment Variable: KDEROOTHOME
Example Setting(s): /root/.kde
Comment: Different variable to prevent root writing to $KDEHOME of the user after running su.

Environment Variable: KDEDIR
Example Setting(s): /opt/kde3, /usr, /usr/kde3
Comment: Vendor dependent. Used by KDE 2. If not set, falls back to compiled-in default.

Environment Variable: KDEDIRS
Example Setting(s): /opt/kde3, /usr, /usr/kde3
Comment: New in KDE3. Can list multiple locations separated by a colon. If not set, falls back to $KDEDIR

Don't need to be set, defaults work just fine.

Running KDE2 next to KDE3? Point $KDEDIR to KDE 2 and $KDEDIRS to KDE 3.

A staff member at a university could have the following settings:

KDEHOME='~/.kde3'
KDEROOTHOME='/root/.kde3'
KDEDIRS='/opt/kde_staff:/opt/kde3'
---------

Hope this helps.

    Best regards,

    Boudewijn

Revision history for this message
Sarah Kowalik (hobbsee-deactivatedaccount) wrote :

[22:59] <Riddell> Hobbsee: 44920 is fixed in edgy

Changed in kdebase:
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.