After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 318882 - Ask for root password when trying to open resources you have insufficient permissions on
Ask for root password when trying to open resources you have insufficient per...
Status: RESOLVED WONTFIX
Product: gnome-vfs
Classification: Deprecated
Component: File operations
2.14.x
Other All
: Normal enhancement
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2005-10-14 19:05 UTC by Alexander “weej” Jones
Modified: 2008-09-06 18:54 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14



Description Alexander “weej” Jones 2005-10-14 19:05:24 UTC
Would be nice if gnome-vfs somehow handled this. I haven't given it much
thought, but I realised today that it is daft that I have to fire up a
completely seperate instance of gedit as root to open a config file when
gnome-vfs could be doing the leg work.

What do you reckon? Perhaps throwing up a password prompt on every "permission
denied" encounter is a bit overkill, but I'm sure we can put our heads together
and think of a compromise? :)

Cheers
Comment 1 Sergej Kotliar 2005-10-15 18:38:30 UTC
This seems very much as a duplicate of bug 65058.
But I agree that doing it at the gnome-vfs layer would be much cooler than doing
it directly in nautilus so I'll leave this bug open. Perhaps you should add this
suggestion to that bug too, cause I too think this needs to be fixed and soon.
Comment 2 Alexander “weej” Jones 2005-10-15 19:00:49 UTC
Excellent, we'd need some way to ensure that root permissions don't remain open,
for example if you opened a file as root user and left it open accidentally,
you'd either need some kind of mechanism built in to remind the user that the
file is open as root, or just ask on every operation, i.e. once to open file,
once to save. Maybe there's something tidier we can do, but leaving root access
open is a lot more dangerous than leaving keyring access to an FTP site open...
if you see what I mean.

I'll make a post on that other bug, I did try a search but couldn't find it.

Cheers
Comment 3 Alexander “weej” Jones 2005-11-30 12:03:24 UTC
Any implementation ideas?
Comment 4 Jordan Nash 2006-06-15 04:08:59 UTC
I am commenting because I also think this feature would be sensible and desirable. 

I would like to be able to move files to areas my account does not have access to on the system, without having to login as root. For example, a person who has a webserver to experiment with on their system (or perhaps even a person who has an sftp/ssh session running graphically), may want to move files they are working on into restricted areas.

Currently, this is accomplished by starting the terminal and logging in as root. I then edit/move/whatever the files using terminal commands. If I really need the GUI, I can start nautilus from the terminal.

It would be nice to avoid all of this by simply requesting my root password, or doing a "run as" style query, where I can select a different user account to "su" to for the duration of the operation.
Comment 5 Paul Betts 2006-09-05 07:07:28 UTC
I saw this bug and thought it was pretty interesting, so I'll throw out a few questions:

Since it's a VFS, does it even make sense that root would give you the ability to do what you want? What about SMB? How would you detect that root would let you do what you wanted? Perhaps the most sensible thing would be

1. Attempt operation
2. If fail, attempt as root()
3. Return success / fail

However, this makes us look dumb if we attempt to sudo root for something that obviously won't help us. Perhaps adding a simple is_local() function to each module would solve this. 

Secondly, how can we intelligently un-sudo? My first inclination would be to say, "sudo on open, unsudo on close". However, that makes a lot of sudo's if you're copying a directory. However, I think this could work if you added two functions:

gnome_vfs_begin_operation_hint() - Indicates the beginning of a user operation, such as a recursive copy that would involve opening and closing lots of files. Basically all this would do is set a flag for the process that would stop close from un-sudo'ing. This way, sudo wouldn't be repeatedly called.

gnome_vfs_end_operation_hint() - Indicates the end of a user operation; if the user is currently sudo'ed and no files are open, they would be un-sudo'ed at 
this point. Otherwise, the standard "unsudo on close" mechanic would apply. 

I think I'd definitely be interested in taking a crack at this, let me know if that would be something people would be willing to commit.
Comment 6 Paul Betts 2006-09-05 07:16:05 UTC
Here's another less important question, are we guaranteed that an X server is running? gnome-vfs has commands that run in a bash shell as well
Comment 7 André Klapper 2008-09-06 18:54:51 UTC
gnome-vfs has been deprecated and superseded by gio/gvfs since GNOME 2.22, hence mass-closing many of the gnome-vfs requests/bug reports. This means that gnome-vfs is NOT actively maintained anymore, however patches are still welcome.

If your reported issue is still valid for gio/gvfs, please feel free to file a bug report against glib/gio or gvfs.

@Bugzilla mail recipients: query for
      gnome-vfs-mass-close
to get rid of this notification noise all together.


General further information: http://en.wikipedia.org/wiki/GVFS 
Reasons behind this decision are listed at http://www.mail-archive.com/gnome-vfs-list@gnome.org/msg00899.html