Subject: bug#19477: closed (24.4; Init script from su terminal)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 31 Dec 2014 19:35:02 +0000

Your bug report

#19477: 24.4; Init script from su terminal

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
19477: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19477
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: 24.4; Init script from su terminal
From: [email-masked] (Álvar Ibeas)
To: [email-masked]
Date: Wed, 31 Dec 2014 20:34:13 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Glenn Morris <[email-masked]> writes:

> Emacs is behaving as documented.
>
> The `su' programs from coreutils (it's since been removed in favour of
> the util-linux one) and util-linux (as used by eg Red Hat) do not change
> LOGNAME or USER when su'ing to root.
>
> It seems that Debian's `su' comes from the `shadow' package and does
> change them.

Thanks for replying. I see now that most of the environment variables
are kept with the `-p' option.

Subject: 24.4; Init script from su terminal
From: [email-masked] (Álvar Ibeas)
To: [email-masked]
Date: Wed, 31 Dec 2014 17:36:58 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

Working under Debian, when I switch to root using `su', Emacs doesn't
load the init script located in my user's home folder, as the manual
says:

``if you run Emacs from a shell started by `su', Emacs tries to find
your own `.emacs', not that of the user you are currently pretending
to be [...] It gets your user name from the environment variables
`LOGNAME' and `USER'.''

The variables LOGNAME and USER have both the value `root'. The command
`logname' returns instead my own user name.

Is this an Emacs bug?