opening existing file with gksu gedit creates untitled document

Bug #838404 reported by Sean Fitzpatrick
48
This bug affects 10 people
Affects Status Importance Assigned to Milestone
gedit
New
Medium
gedit (Ubuntu)
Triaged
Low
Unassigned

Bug Description

When opening a text file as super user, using gksu gedit ...., the requested file opens, along with a second, untitled document. This is slightly annoying, since gedit will ask if the untitled document should be saved once the desired file has been edited and gedit is closed. Opening a file as a regular user does not have this problem.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: gedit 3.1.4-0ubuntu1
ProcVersionSignature: Ubuntu 3.0.0-9.15-generic 3.0.3
Uname: Linux 3.0.0-9-generic i686
Architecture: i386
Date: Wed Aug 31 14:12:52 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
SourcePackage: gedit
UpgradeStatus: Upgraded to oneiric on 2011-08-26 (4 days ago)

Revision history for this message
Sean Fitzpatrick (sean-fitzpatrick) wrote :
Changed in gedit (Ubuntu):
status: New → Confirmed
Sam_ (and-sam)
tags: added: regression-release
Changed in gedit:
importance: Unknown → Medium
status: Unknown → New
Changed in gedit (Ubuntu):
importance: Undecided → Low
status: Confirmed → Triaged
Revision history for this message
Sam_ (and-sam) wrote :

Quote comment from upstream developer:
< You shouldn't start GNOME programmes with elevated privileges, it's not
supported. In any case, not a gnome-terminal bug. >

Revision history for this message
Sean Fitzpatrick (sean-fitzpatrick) wrote :

I see. So does that make the official GNOME position "editing system files should be done with nano or similar" or "system files? why would a user want to edit a system file?"

Revision history for this message
Sam_ (and-sam) wrote :

Yep, from my understanding they don't agree with running graphical apps as root. Bug #805682

Sam_ (and-sam)
tags: added: precise
Revision history for this message
david6 (andrew-dowden) wrote :

Does this mean (based on Bug #805682) we should:

(a.) henceforth use sudo gedit systemfile (with some security issues)

OR,

(b.) agitate for this to be fixed, and soon.

??

Revision history for this message
Eliah Kagan (degeneracypressure) wrote :

I don't dispute that this bug is a duplicate of bug 796076, but I am posting here to address some advice from david6 which is potentially dangerous if applied.

It is a bad idea to run graphical programs that save user-specific configuration data, like gedit, with sudo (without special flags to make it behave like those programs[1]) rather than gksu/gksudo/kdesudo. But not for security reasons. This is a bad idea because such programs often create or modify configuration data in such a way that the configuration files are accessible only by root, and then the application is fully or partially broken when run by the user unprivileged. (This could then become a security problem if the configuration data contained secret information which was then oversimplistically changed back to be owned by the non-root user, but I am not aware of any situation where this has been a problem, especially since such users are usually administrators who are permitted to read the data anyway.) See https://help.ubuntu.com/community/RootSudo for details.

[1] Actually, those programs are graphical frontends for sudo, and they make sudo behave properly by passing special flags such as -H. (But it is a bit more complex than that, so you may still experience some problems if you run sudo -H instead of gksu/gksudo/kdesudo.)

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.