GNOME Bugzilla – Bug 352886
If file is opened readonly due to permissions, offer privilege escalation through PolicyKit (to enter the sudo or root password) to edit
Last modified: 2020-11-24 09:57:24 UTC
If I open a file as "read only" (like normal user) I would like to have the option to edit it if I enter the root password (using gksu maybe?). It´s not absolutely necesary, but it would be for convenience, so you don´t have to open Gedit from the command line using sudo.
Confirming since I just got the issue: my father had to modify a file in /etc and it's real PITA to explain how he should open a terminal and type sudo gedit $file. Another idea: maybe if the user is able to perform admin tasks (either using or sudo) the file should be opened as editable and then hitting the save button could ask for a password using gksu(do). IMHO this can be done by piping the file content into a second binary that is ran as root through gksudo and performs the save (a custom DocumentSaver ?). Not sure there is an easier way to do that.
Hello, I would also like to have that feature in gedit. By the way, the application TextWrangler in MacOSX does it that way. Have a nice day. Francesco
*** Bug 384514 has been marked as a duplicate of this bug. ***
I wonder whether it be possible by using policykit!?
Now that would be a very nice and most welcome addition
*** Bug 529326 has been marked as a duplicate of this bug. ***
Just another person who thinks this would be a great addition. More than once (today in fact), I've spent time editing some file only to find I can not save it and have to go through the trouble of re-editing, this time under sudo. Thanks to anyone who is able to work on this, and I hope to see this feature in the future.
+1 to this idea. Would be really useful.
See also bugs #561443 and #490200. We'd like to see this go into gvfs/gio so that we can all benefit from this.
Is bug 524199 a duplicate of this one?
*** Bug 524199 has been marked as a duplicate of this bug. ***
I've only been waiting for this for a decade. It is even more needed than previously, now, because running gedit as root causes your desktop to explode: https://bugzilla.redhat.com/show_bug.cgi?id=1037285 and the response I got to that bug was 'don't do that'. If this bug isn't fixed, I really don't have a good alternative.
I don't know if it can help but Nautilus had to solve a "similar" problem : see Bug 773937 - Add admin backend support
Retitling for clarity and searchability. Would make sense even today because when helping some users troubleshoot their systems and they need to edit, for example, their software repositories or selinux config or whatnot, they have to either use a commandline text editor, or often end up being advised to "sudo gedit" (instead of gksudo or whatever), which is problematic for various reasons as sudo really isn't meant to interact well with graphical apps in general (see https://superuser.com/questions/202676/sudo-vs-gksudo-difference). From a UI perspective, I would imagine this being implemented with an infobar.
More to the point, 'sudo gedit' doesn't work under Wayland, and it's generally agreed that apps need to handle requesting root privileges when they need them (and only when they need them) rather than expect to be run wholly as root. There is already support for this in GVFS, I believe - you can do 'gedit admin:///etc/someconfigfile.conf' - but it still needs hooking up to the gedit GUI in the appropriate ways.
*** Bug 779988 has been marked as a duplicate of this bug. ***
Proposal, based of how Nautilus handles it and how it could be used in gedit: - Case 1: if a file is native, but permissions do not allow the user to read it: Immediately switch to using admin://, therefore, user must provide their credentials. If they don't, or if they fail, present the normal error message dialog box. - Case 2: if a file is native, and the user can read the file but permissions inhibit writing to the file: Load the file read-only, but present an infobox similar to the following: You don't have permission to save your changes back to the original file. Save to a different location or authenticate as an administrator. [Authenticate] [Ignore] This allows write-protected files to be read without authenticating, but gives the option to do so. Alternatively, the save button could be re-enabled for those write-protected files, but some sort of change could be made to the appearance of the button when authentication is required, and authentication would only be required on first save of that session for that file. For example, on Windows versions after Vista, the UAC Shield appeared on actions that required the user pass UAC authentication.
Mass-closing of all gedit bugzilla tickets. Special "code" to find again all those gedit bugzilla tickets that were open before the mass-closing: 2bfe1b0590a78457e1f1a6a90fb975f5878cb60064ccfe1d7db76ca0da52f0f3 By searching the above sha256sum in bugzilla, the gedit contributors can find again the tickets. We may be interested to do so when we work on a specific area of the code, to at least know the known problems and possible enhancements. We do this mass-closing because bugzilla.gnome.org is being replaced by gitlab.gnome.org.