You are not logged in.

#1 2010-12-22 23:53:06

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 726
Website

Danger of running EmelFM2 as root: configuration blown away!

Say you have a customized EmelFM2 configuration in /home/user/.config/emelfm2/ running as an ordinary user. Close EmelFM2, open up a root terminal and issue the 'emelfm2' command. Then close EmelFM2 and you'll see that the files within /home/user/.config/emelfm2/ are now owned by root! Run EmelFM2 as an ordinary user after this and these files will be overwritten with the default EmelFM2 configuration files, owned again by user rather than root. Your original customized configuration is lost forever ...

I think I've pinned down where the problem lies in the source: lines 305-307 in 'config/e2_cl_option.c' read:

    if (e2_cl_options.config_dir == NULL)
    {
        usedir = g_getenv ("XDG_CONFIG_HOME");

If a configuration location isn't specified on the EmelFM2 command line, it defaults the location using $XDG_CONFIG_HOME which will still be set to the user's configuration directory even within a root terminal.

Any ideas about this, or is it really an upstream bug?

Offline

#2 2010-12-23 00:06:29

knopwob
Member
From: Hannover, Germany
Registered: 2010-01-30
Posts: 239
Website

Re: Danger of running EmelFM2 as root: configuration blown away!

how did you open the root terminal? It sounds, like you are using

 su

instead of

su -

Last edited by knopwob (2010-12-23 00:12:12)

Offline

#3 2010-12-23 00:21:16

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 726
Website

Re: Danger of running EmelFM2 as root: configuration blown away!

knopwob wrote:

how did you open the root terminal? It sounds, like you are using

 su

instead of

su -

Ah yes, yes ... you are so right. Using the latter (forcing a login shell?) indeed works as expected, using /root/.config/emelfm2/ by default.
So, if I want to run EmelFM2 as root from (say) a keyboard shortcut, Gmrun or an Openbox menu item, what would be the safe way to do this? (I tried gksudo with the -l option, but it doesn't seem to work.)

Edit: Of course, just 'gksudo emelfm2' should, and seems to, work okay.

Last edited by ninian (2010-12-23 00:35:42)

Offline

Board footer

Powered by FluxBB