emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs creates emacs.d/ as root when using sudo


From: Teemu Likonen
Subject: Re: Emacs creates emacs.d/ as root when using sudo
Date: Tue, 02 Jul 2019 09:16:00 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux)

Jeffrey Walton [2019-07-01 14:01:58-04:00] wrote:

> I think emacs should be creating files in user's $HOME as $SUDO_USER,
> not root. Or, emacs should be creating .emacs.d/ in /root, not user's
> $HOME.

This is about sudo's settings, not Emacs's. See sudo's option "-H" (man
sudo):


    -H, --set-home
                Request that the security policy set the HOME
                environment variable to the home directory specified by
                the target user's password database entry. Depending on
                the policy, this may be the default behavior.


Or "man sudoers":


     always_set_home   If enabled, sudo will set the HOME environment vari‐
                       able to the home directory of the target user (which
                       is root unless the -u option is used).  This effec‐
                       tively means that the -H option is always implied.
                       Note that by default, HOME will be set to the home
                       directory of the target user when the env_reset
                       option is enabled, so always_set_home only has an
                       effect for configurations where either env_reset is
                       disabled or HOME is present in the env_keep list.
                       This flag is off by default.



-- 
/// Teemu Likonen   <https://github.com/tlikonen> //
// PGP: 4E1055DC84E9DFF613D78557719D69D324539450 ///

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]