There are good reason for running geany via sudo, as opposed to gksudo.
I'm aware of bug #294, and why this happens with sudo and not gksudo. (In short, because gksudo sets $HOME to /root, while sudo leaves $HOME to same as user - and if user is already running geany in their user session, an attempt to open the same config file will be made, and fail).
Please allow me to explain why this shouldn't be dismissed as "not a bug", just because there is a workaround. The problem is not just that sudo works differently than gksudo. The problem is that, and Geany's flawed implementation of config file (or "domain socket" or whatever is going on with that file).
Like many Linux administrators / power users, I use GUI tools with sudo very often, for three related reasons: 1) I prefer working in a terminal; 2) I prefer GUI terminals for ease-of-use [e.g. highlight/copy/paste, color, resize]; and 3) I prefer using sudo in a GUI terminal instead of gksudo, so that I don't have to input my password every single time I open a system configuration file for editing - which is often.
I use many GUI tools this way, and none of them have the problems Geany has. I love Geany - both for system configuration file editing as well as personal file editing, but have had to quit using it because this bug prevents productivity way too often.
It is a bug because a very simple and common use case is prohibited for no good reason, shouldn't be prohibted, and no other similar tools have the same prohibition.
A fix should be simple, in theory. Either:
Don't use temporary config files [or whatever is being referenced by "domain socket error"], or
Detect if $USER == "root" but $HOME points to somewhere in /home. If so, use /root if it exists, or %TMP% as a fallback (in a unique and secure way that has been exhaustively documented elsewhere on the nets).
Sure, the second one - without additional smarts - might not catch all distributions and/or custom installs, but would cover 99%+ of the user base. And for that tiny percentage that it might not cover, their situation wouldn't be any worse that it is now.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.