GNU bug report logs -
#36583
26.1; emacs 26 tries loading original user's .emacs after su to root
Previous Next
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> [...hhhmmm...] Ha! Found it!
>
> commit a726e0d12ccb1c49ca1f3e1fbe64addea9b7d3b4
> Author: Jim Blandy <jimb <at> redhat.com>
> Date: Thu Jul 11 23:17:40 1991 +0000
>
> Initial revision
>
> diff --git a/lisp/startup.el b/lisp/startup.el
> --- /dev/null
> +++ b/lisp/startup.el
> @@ -0,0 +160,6 @@
> + ;; Figure out which user's init file to load,
> + ;; either from the environment or from the options.
> + (setq init-file-user (if noninteractive nil (user-login-name)))
> + ;; If user has not done su, use current $HOME to find .emacs.
> + (and init-file-user (string= init-file-user (user-real-login-name))
> + (setq init-file-user ""))
>
> So yes, goes back pretty far.
Oh, wow. :-)
There was a similar bug report for "sudo" the other week where the
conclusion was "well, just use -i" (because then $HOME would be set
correctly). Does this mean that su and sudo behaves differently in
Emacs in this area? Let's see...
sudo -i:
root <at> sandy:~# echo $HOME
/root
(user-real-login-name)
"root"
sudo bash:
root <at> sandy:~# echo $HOME
/home/larsi
(user-real-login-name)
"root"
[larsi <at> stories ~]$ su
Password:
root <at> stories:/home/larsi# echo $HOME
/root
(user-real-login-name)
"root"
Uhm...
So when I su on this machine, I'm not getting /home/larsi/.emacs?
This is kinda confusing.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 124 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.