Bug 220511 - Unable to run nautilus as a root user.
Summary: Unable to run nautilus as a root user.
Status: VERIFIED FIXED
Alias: None
Product: openSUSE 10.2
Classification: openSUSE
Component: GNOME (show other bugs)
Version: Beta 2
Hardware: Other Other
: P5 - None : Major with 3 votes (vote)
Target Milestone: ---
Assignee: Hans Petter Jansson
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-13 17:51 UTC by Joe Harmon
Modified: 2008-05-22 18:18 UTC (History)
1 user (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Harmon 2006-11-13 17:51:44 UTC
If I try an launch nautilus as a root user, it will not launch. I have tried going into a terminal, su to root, and then typing in nautilus. Nothing happens. I don't even get any messages in the terminal. I have also tried typing gnomesu nautilus. Same result.

I do this because often times I need to edit or attach log files that are in a restricted area. Like /var/log.
Comment 1 Hans Petter Jansson 2006-11-14 03:52:19 UTC
I don't think this has ever worked, and if it did, it won't do what you expect. Under the circumstances you describe, Nautilus is designed to signal the existing process, telling it to open another window.

The fact that this doesn't work if you're root telling the owner of the current session's Nautilus to open another window, may be considered a bug. But even if this was fixed, the new window will not have root privileges.

Another possible fix would be to launch a -nodesktop Nautilus window in a separate process, as root. This means root will get a gconfd, etc. The window may look different since root's preferences will be used, not the user's.

However, I consider the latter a new feature and not a bug fix. Note that this is complicated by the fact that "root" can be any other user, in theory.
Comment 2 Joe Harmon 2006-11-14 13:03:25 UTC
I don't understand this last comment at all. This has always worked and it did open up with root privileges and therefore is a bug.
Comment 3 Hans Petter Jansson 2006-11-15 01:38:58 UTC
Okay. If it used to work, I'm in the wrong here. I still wonder if this is something we should support doing, though. Ideally there would be some sort of privilege escalation support in Nautilus proper (similar to authenticating to remote shares).
Comment 4 JP Rosevear 2006-11-17 16:36:28 UTC
It runs it SLE 10 and it works in 10.2 if you do 'su -' but not 'su' or 'gnomesu'
Comment 5 Joe Harmon 2006-11-17 16:56:55 UTC
(In reply to comment #4)
> It runs it SLE 10 and it works in 10.2 if you do 'su -' but not 'su' or
> 'gnomesu'

It works on SLE without having to do the su -

Comment 6 Toru Marumoto 2007-02-06 15:22:36 UTC
same problem here as well. After upgrading to openSUSE 10.2, I realized I can not launch nautilus as root anymore.

So I did some research and experiments and found that 

$sudo -i
$DISPLAY=:0 nautilus

works.

Also,gdmsetup needs the same procedure too.

$sudo -i
$gdmsetup

Comment 7 JP Rosevear 2007-02-09 19:56:15 UTC
Could be a duplicate of 229209
Comment 8 Hans Petter Jansson 2007-02-14 02:58:18 UTC
Toru: Is the "DISPLAY=:0" before "nautilus" really necessary? Why isn't it necessary before "gdmsetup"?

Can you issue the command "set >broken-session.txt" after su'ing (when nautilus will _not_ work) and "set >working-session.txt" after sudo -i'ing (when it _will_ work), and attach the diff between those two files (using "diff -u broken-session.txt working-session.txt >session-diff.txt") to this bug?
Comment 9 Toru Marumoto 2007-03-03 20:07:30 UTC
Sorry! I'm late.

Opps. I needed the "DISPLAY=:0" before "gdmsetup". My bad.

$sudo -i
$gdmsetup

gives me

(gdmsetup:5106): Gtk-WARNING **: cannot open display:


>Can you issue the command "set >broken-session.txt" .. snip

No. It seems cursor is just blinking. 

I just updated the other PC from 10.1 to 10.2.
Yap, I'm no longer be able to launch nautilus as root 
(unless I use the trick above).

Comment 10 David Liang 2007-04-02 01:55:47 UTC
The bug is caused by dbus package.
After I debugged the  dbus code, I found that nautilus is hung at the _dbus_mutex_lock function( dbus-1.0.0/dbus/dbus-thread.c ). 
It seems that SU command do not make the dbus-session service to work well, 
we need to use `dbus-launch --auto-syntax` command to start dbus-session service.

So my suggestion is: take three steps:
1. $su
2. $dbus-launch --auto-syntax
3. $nautilus
Comment 11 Magnus Boman 2007-04-27 05:15:23 UTC
Removing needinfo from Toru as per comment#9
Comment 12 JP Rosevear 2007-11-14 19:42:48 UTC
Joe reports this works fine with su and su - in 10.3.