You are not logged in.

#1 2011-05-13 12:53:12

ulke
Member
Registered: 2011-04-29
Posts: 50

"gksudo gedit somefile" opens additional, empty file

Hi,

I use Gnome 3 with the Gnome Shell. Whenever I edit a file using "gksudo gedit", gedit opens an additional, empty file in a tab labelled "Unsaved Document 1". The empty file is marked as edited, so if I try to close it I get an annoying "Save the changes" window.

There's no console output from gedit while it's running, however once I close it I see this:

(gedit:25657): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

(gedit:25657): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.S375UV': No such file or directory

(gedit:25657): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
[uli@EMACS-Keller log]$ gksudo gedit /etc/ppp/pppoe.conf

(gedit:25670): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.60JYUV': No such file or directory

(gedit:25670): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

which seems unrelated and easily fixable.

Any ideas why this is happening and how to fix it?

Offline

#2 2011-05-13 18:06:42

dodo3773
Member
Registered: 2011-03-17
Posts: 814

Re: "gksudo gedit somefile" opens additional, empty file

ulke wrote:

Hi,

I use Gnome 3 with the Gnome Shell. Whenever I edit a file using "gksudo gedit", gedit opens an additional, empty file in a tab labelled "Unsaved Document 1". The empty file is marked as edited, so if I try to close it I get an annoying "Save the changes" window.

There's no console output from gedit while it's running, however once I close it I see this:

(gedit:25657): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

(gedit:25657): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.S375UV': No such file or directory

(gedit:25657): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
[uli@EMACS-Keller log]$ gksudo gedit /etc/ppp/pppoe.conf

(gedit:25670): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.60JYUV': No such file or directory

(gedit:25670): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

which seems unrelated and easily fixable.

Any ideas why this is happening and how to fix it?


Did you try just

gksu gedit filename

Offline

#3 2011-05-15 08:41:51

martvefun
Member
From: The Internets
Registered: 2009-12-19
Posts: 174

Re: "gksudo gedit somefile" opens additional, empty file

I had the same problem and it fixed it. Thanks
What's the difference between the two ?


English is not my native language, sorry for the mistakes
Arch amd64, GNOME, Dell Vostro

Offline

#4 2011-05-15 12:48:24

sudokill
Member
Registered: 2011-04-27
Posts: 54

Re: "gksudo gedit somefile" opens additional, empty file

I get that too it's annoying. I just use nano for everything now, been having other problems with gksu and gksudo in arch

Offline

#5 2011-05-15 16:39:39

dodo3773
Member
Registered: 2011-03-17
Posts: 814

Re: "gksudo gedit somefile" opens additional, empty file

martvefun wrote:

I had the same problem and it fixed it. Thanks
What's the difference between the two ?

The difference is gksu allows you to edit files graphically like su as root and gksudo does the same but with sudo. The way I look at it if I need those type of permissions I am usuallly editing a file that is owned by root anyway so no worries. In fact gksudo is just a symlink to gksu anyways. gksudo= gksu -S (aka   gksu --sudo-mode). Check out "man gksu"  and look at

ls -l /usr/bin | grep gksu

-rwxr-xr-x 1 root root      19412 Feb  6 03:39 gksu
lrwxrwxrwx 1 root root          4 Feb  6 03:39 gksudo -> gksu

Last edited by dodo3773 (2011-05-15 16:43:19)

Offline

#6 2011-05-17 08:59:36

martvefun
Member
From: The Internets
Registered: 2009-12-19
Posts: 174

Re: "gksudo gedit somefile" opens additional, empty file

Thank you for the explanation

       ...
       Notice  that  all the magic is done by the underlying library, libgksu.
       Also notice that the library will decide if it should use su or sudo as
       backend  using the /apps/gksu/sudo-mode gconf key, if you call the gksu
       command. You can force the backend by using the gksudo command,  or  by
       using the --sudo-mode and --su-mode options.
       ...

English is not my native language, sorry for the mistakes
Arch amd64, GNOME, Dell Vostro

Offline

Board footer

Powered by FluxBB