Subject: bug#36604: 26.1; emacs 26 tries loading original user's .emacs after su to root

From: Steinar Bang <[email-masked]>
Date: Thu, 11 Jul 2019 18:45:52 +0100

- I did /bin/su from my own user to root

 - When I started emacs I got the following error message:

 Warning (initialization): An error occurred while loading ‘/home/sb/.emacs’:

File is missing: Cannot open load file, No such file or directory, editorconfig

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.

 - Ie. emacs tried to load the original user's .emacs and fails (and the
   configuration of the editor is kind of broken)

Results of HOME and id after su:
root@cadalora:~# env | grep HOME
HOME=/root
root@cadalora:~# id
uid=0(root) gid=0(root) groups=0(root)
root@cadalora:~#

 - When I do "/bin/su - root" then emacs reports no error messages on
   startup

Results of HOME and id looks the same:
root@cadalora:~# env | grep HOME
HOME=/root
root@cadalora:~# id
uid=0(root) gid=0(root) groups=0(root)
root@cadalora:~#

In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.4)
 of 2019-02-03, modified by Debian built on zam904
Windowing system distributor 'The Cygwin/X Project', version 11.0.12004000
System Description:	Debian GNU/Linux 10 (buster)

Recent messages:
Reading active file from news via nntp...
Opening nntp server on news...done
Reading active file from news.gmane.org via nntp...
Opening nntp server on news.gmane.org...done
Reading active file via nndiary...done
nnimap read 0k from imap.bang.priv.no
Reading active file via nndraft...done
Checking new news...done
nnimap read 0k from imap.bang.priv.no
Exiting summary buffer and applying spam rules

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --enable-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --build
 x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd
 --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --with-x=yes
 --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs-26.1+1=. -fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2

Important settings:
  value of $LC_COLLATE: POSIX
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  cursor-sensor-mode: t
  gnus-undo-mode: t
  editorconfig-mode: t
  display-time-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/sb/apps/share/emacs/site-lisp/icalendar hides /usr/share/emacs/26.1/lisp/calendar/icalendar

Features:
(shadow bbdb-message editorconfig-core editorconfig-core-handle
editorconfig-fnmatch emacsbug sendmail sort gnus-cite ansi-color
mail-extr u-appt appt diary-lib diary-loaddefs cal-menu calendar
cal-loaddefs gnus-async gnus-bcklg qp gnus-ml spam-gmane dns mm-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util disp-table edmacro kmacro gnus-topic cursor-sensor
nndraft nnmh utf-7 rfc2104 cl-extra help-mode network-stream nsm
starttls gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-cache
gnus-demon nntp gnus-diary nndiary spam-report spam spam-stat bbdb-com
crm bbdb bbdb-site timezone gnus-uu yenc gnus-msg gnus-art mm-uu mml2015
mm-view mml-smime smime dig mailcap supercite regi elec-pair desktop
frameset cl nnir gnus-sum gnus-group gnus-undo gnus-start gnus-cloud
nnimap nnmail mail-source tls gnutls utf7 netrc parse-time gnus-spec
gnus-int gnus-range message rmc puny dired dired-loaddefs format-spec
rfc822 mml mml-sec epa derived epg mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus
wid-edit nnoo nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils nxml-psgml-compatibility
easy-mmode crappy-jsp-mode js advice json map imenu thingatpt cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs sgml-mode dom editorconfig rx filladapt time iso-transl
jka-compr finder-inf info package easymenu epg-config url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv
cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 290773 82854)
 (symbols 48 37739 32)
 (miscs 40 88 227)
 (strings 32 90047 6859)
 (string-bytes 1 3369917)
 (vectors 16 36967)
 (vector-slots 8 764061 16798)
 (floats 8 250 285)
 (intervals 56 1200 1573)
 (buffers 992 23))