Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] Manual needs update on 'sudo-ed apps running with user conf'  (Read 2559 times)

braveheartleo

  • Guest
From http://wiki.debian.org/sudo:
Quote
Wrong HOME (and profile settings) behavior

If you are having problems when you sudo to your shell and your $HOME (and profile settings) doesn't work as expected because your new HOME is /root, you need to know that the default sudo configuration in Squeeze resets all environmental variables. To restore the old behavior of preserving the user's $HOME environment variable you can add this to your /etc/sudoers configuration file:

Defaults env_keep += HOME

Then the precaution given by the  manual, where running sudo
Quote
leads to running a root application with a users configuration, which may override or change permissions.
is inaccurate, at least in the Debian context.

I request that the manual be updated accordingly to clarify that sudo's default behavior in Debian is not such as that of sudo in Ubuntu, https://help.ubuntu.com/community/RootSudo#Graphical_sudo, where:
Quote
Graphical sudo

You should never use normal sudo to start graphical applications as Root. You should use gksudo (kdesudo on Kubuntu) to run such programs. gksudo sets HOME=~root, and copies .Xauthority to a tmp directory. This prevents files in your home directory becoming owned by Root.


Case in point:

Run the following in a terminal, using default su and sudo settings:
Code: [Select]
# sudo-1.8.5p2-1 in Debian sid
johndoe@debian:~$ sudo env     # johndoe is member of sudo group
USER=root
HOME=/root
SUDO_COMMAND=/usr/bin/env
SUDO_USER=johndoe
SUDO_UID=1000
SUDO_GID=1000

# sudo-1.8.3p1-1ubuntu3 in Xubuntu 12.04
johndoe@ubuntu:~$ sudo env
HOME=/home/johndoe
USER=root
SUDO_COMMAND=/usr/bin/env
SUDO_USER=johndoe
SUDO_UID=1000
SUDO_GID=1000
As can be seen from above, replacing env with any other command, the running environment sudo in Debian sets is HOME=/root and not HOME=/home/johndoe, unless "Defaults env_reset += HOME" in /etc/sudoers is used. This is very much different from the sudo in Ubuntu, which requires using gksudo to properly set HOME=/root, which prevents sudo from messing with the user's profile and/or configuration permissions.

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.358
    • Land of the Buckeye
RE: Manual needs update on
« Reply #1 on: 2012/12/13, 13:33:30 »
The manual has a headline:  "sudo is not supported"

That is clear -- why should someone write more about that?
System76 Oryx Pro, Intel Core i7-11800H, SSD 970 EVO Plus;  Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO

braveheartleo

  • Guest
Re: RE: Manual needs update on
« Reply #2 on: 2012/12/13, 14:47:25 »
Quote from: "dibl"
That is clear -- why should someone write more about that?

By "clarify," I meant to remove or replace the second paragraph of that section, which inaccurately describes sudo's behavior in Debian being the same as that of in Ubuntu, which is consequently used to further reinforce that the use sudo is not supported in Siduction.

Perhaps I pay pedantic attention to details at times, but I believe providing accurate information wherever it appears in the documentation is to everyone's gain, whether they be siduction users or just plain online searchers. :)