From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#36583: 26.1; emacs 26 tries loading original user's .emacs after su to root Date: Fri, 12 Jul 2019 16:34:05 +0200 Message-ID: References: <87ims94p6p.fsf@dod.no> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="24038"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Steinar Bang , 36583@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 12 16:38:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hlwgj-0005rs-B3 for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Jul 2019 16:38:18 +0200 Original-Received: from localhost ([::1]:50116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlwep-0002tW-S7 for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Jul 2019 10:36:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45720) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlwdf-00060A-LZ for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2019 10:35:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlwdd-0003Pc-5z for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2019 10:35:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59884) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hlwda-0003NL-88 for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2019 10:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hlwda-0007wn-3t for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2019 10:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Jul 2019 14:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36583 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug wontfix Original-Received: via spool by 36583-submit@debbugs.gnu.org id=B36583.156294205830495 (code B ref 36583); Fri, 12 Jul 2019 14:35:02 +0000 Original-Received: (at 36583) by debbugs.gnu.org; 12 Jul 2019 14:34:18 +0000 Original-Received: from localhost ([127.0.0.1]:40472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlwcr-0007vn-Ek for submit@debbugs.gnu.org; Fri, 12 Jul 2019 10:34:17 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:45508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlwcm-0007vY-Ab for 36583@debbugs.gnu.org; Fri, 12 Jul 2019 10:34:15 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hlwcf-0006uI-7P; Fri, 12 Jul 2019 16:34:07 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAD1BMVEX+/gfj2Qr//whAOgT/ /wkKSUWSAAACfklEQVQ4jU2U2xmkIAyFI04BXCwgRAogxgIU6b+mPXFm91teUH5zOwmStFvnfLY5 47xPPGkqPfNCInPdHNzbHMAWRKK2F+DDJ0vbZORZVeaQNF4gOvcc7kMktP0AGHIt1GSytj3TcjCF zx7DnLMhRmtCRfbIoWSisMbPnMMBPFKhPVKolimUSENEAIawA5xJNbegazQRDy5shHesPYubSruQ 1RQi5dX9cz3G2olFylbJzfByUCKpGc8BwMaN4Aw/9WBlhisxmIqKg1sFADlLIeFVufbPrJTMs1wO WjX1EIjMrDeAYhvyQeKmCaUXpRTFgZlGB9ViyYFMySAaggNYCIjSZe0cfuBrYZ0kAEDyqv0Lbsqs pgzVOuqT2h1wa5fXYQZ1ag9lk/0FCO5AiqEwaGsiazzFTplfsH5BACghih3TgbQBEGRRnIrJEux8 wQxcLIqntOZmvGQ7m4PBYiiEAPZ8Q6i/gARqoVkAz1EBjp8rL1C9yX3U/uDt/A9g2qQe7dLnnLdC Xvu8IAnAfrRm6waXDqC4p8TUJmMsrpKZ0wsu2jAmkBCJ4SR9oF+BD7g6hDmEvWTxL9UFwobgBwdm SUvGBEwpudrP1QlHIvrk5hfgPssLFACDxU2fo+FiydRiHVEMYMCinmiSDgArhvLMIh0+3Pt56YRF m6Vgg0n0GDKebejXVSku4YMxQOelrdsoTdHgATC/4BQeoyDRD6R8XbWvK4zOGNZwoQFme4NfHryH EaalVE7/9E33Wj1dTSn5INvp6dz9X4Hv1j+QW1vjEpe/krx7D3Sp+1Pvw1fE1xTzfnkffPBxAnzR dy3pt+Jvv35oWRbcTkIevvBzmH8AXd+kTBu5Ba4AAAAASUVORK5CYII= In-Reply-To: (Stefan Monnier's message of "Thu, 11 Jul 2019 20:38:55 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:162774 Archived-At: Stefan Monnier writes: > [...hhhmmm...] Ha! Found it! > > commit a726e0d12ccb1c49ca1f3e1fbe64addea9b7d3b4 > Author: Jim Blandy > 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@sandy:~# echo $HOME /root (user-real-login-name) "root" sudo bash: root@sandy:~# echo $HOME /home/larsi (user-real-login-name) "root" [larsi@stories ~]$ su Password: root@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