GNU bug report logs - #36583
26.1; emacs 26 tries loading original user's .emacs after su to root

Previous Next

Package: emacs;

Reported by: Steinar Bang <sb <at> dod.no>

Date: Wed, 10 Jul 2019 20:24:02 UTC

Severity: minor

Merged with 19477, 36604

Found in version 26.1

Full log


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: sb <at> dod.no, larsi <at> gnus.org, 36583 <at> debbugs.gnu.org, Richard Stallman <rms <at> gnu.org>
Subject: bug#36583: 26.1; emacs 26 tries loading original user's .emacs after su to root
Date: Mon, 15 Jul 2019 09:04:51 -0400
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> How 'bout let the /root/.emacs file do something like:
>
>     (load (concat "~" (user-login-name) "/.emacs"))
>     
> ?
> For convenience, we could provide an ad-hoc function that would do that
> "right" (i.e. looking for .emacs, .emacs.d/init.el, and things like
> that).  We could even put it in /root/.emacs.d/early-init.el.

Wouldn't it be simpler to do this in the shell, e.g.,

    cat >>/root/.bashrc <<'EOF'
    alias emacs='emacs -u "$LOGNAME"'
    EOF

although I would personally suggest

    cat >>/root/.bashrc <<'EOF'
    alias emacs='echo Do not run emacs as root'
    EOF




This bug report was last modified 123 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.