From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: tomas@tuxteam.de Newsgroups: gmane.emacs.help Subject: Re: How to make emacs stop trying to load /home/sb/.emacs after su to root? Date: Tue, 9 Jul 2019 22:20:47 +0200 Message-ID: <20190709202047.GF15938@tuxteam.de> References: <864l3w18ae.fsf@dod.no> <48B6632F-49C3-4C40-A559-D839FEE11061@easesoftware.com> <8736jf2fus.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me> <20190709191532.GE15938@tuxteam.de> <87wogr0ybf.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="V4b9U9vrdWczvw78" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="193797"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Perry Smith , help-gnu-emacs@gnu.org, Steinar Bang To: Tomas Nordin Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 09 22:21:39 2019 Return-path: Envelope-to: geh-help-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 1hkwcN-000oI2-36 for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Jul 2019 22:21:39 +0200 Original-Received: from localhost ([::1]:55868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkwcL-0001a3-OZ for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Jul 2019 16:21:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47111) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkwc6-0001Mo-1u for help-gnu-emacs@gnu.org; Tue, 09 Jul 2019 16:21:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkwc2-0005XF-4J for help-gnu-emacs@gnu.org; Tue, 09 Jul 2019 16:21:21 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:46108) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkwbz-0005MO-Qj for help-gnu-emacs@gnu.org; Tue, 09 Jul 2019 16:21:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=zM1IWDIFh4b3/NT7efGI1W1OU1+aYq+s/6mKN8dhI1w=; b=TcCThp+tsjIGH0IxMctrpHH4XRk7TnSHt5EZ+8eVvmpveG/2kHez8UTx8+XqPcSesc9BWvDdwGHp8yaJEqwIDcqvOuOzO/brLATxKe4X0zktlXKXdLUAuiXZHRLYuKDLpXS1fcoW6lRJmmpjtn0+AgqUJ7EbzbZ5XMGDoEPi9hxc8D4gjPEnjwLrXlzodGlSJWpxmTFGQThvYkAy3C7GBpLEfZ5hKaxviYoVF7xOZdBabsGdHq2qQMj6X/3FY9YZdOpnii/xIUQ/EowlAXqRkjhIdW9OUt7WVEIAB9Gz3T7j/U8JYQIsQESJpjP9KkYFG9smNDmp9SUUVfh6kYnIaw==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1hkwbX-0006r2-M4; Tue, 09 Jul 2019 22:20:47 +0200 Content-Disposition: inline In-Reply-To: <87wogr0ybf.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:121132 Archived-At: --V4b9U9vrdWczvw78 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 09, 2019 at 10:04:20PM +0200, Tomas Nordin wrote: > tomas@tuxteam.de writes: >=20 > > On Tue, Jul 09, 2019 at 09:00:11PM +0200, Tomas Nordin wrote: > >> Perry Smith writes: > > > > [...] > > > >> >> How can I make emacs stop loading the original user's .emacs when > >> >> logged in as root? > >> > > >> > Can you do =E2=80=9Cid=E2=80=9D after you do the su? Usually =E2=80= =9Csu - root=E2=80=9D is the suggested method. > >> > The =E2=80=98-=E2=80=98 causes the users environment to get loaded o= r something. Never looked > >> > too deep into it. > >>=20 > >> After su; > >>=20 > >> # id > >> uid=3D0(root) gid=3D0(root) groups=3D0(root) > >>=20 > >> After su - root; > >>=20 > >> # id > >> uid=3D0(root) gid=3D0(root) groups=3D0(root) > >>=20 > >> but after this latter way of getting root emacs did not try to load > >> /home/tomas/.emacs > >>=20 > >> Just metooing > > > > Have you checked the environment? What does $HOME say? (although the > > "su -" part lets one expect that the HOME var is set anew: checking > > won't hurt :-) >=20 > echo $HOME gave /root after both su methods Hm. Was somewhat to be expected. Still... bizarre. You could try to compare the result of "set" (displays the whole environment) after both "su" variants: perhaps you find an environment variable which could explain this behaviour. As a guide you can look up the env variables relevant to Emacs in the manual; online here [1] [2]. But we don't know (yet) whether an env variable is the culprit (although it seems compelling...) Cheers [1] https://www.gnu.org/software/emacs/manual/html_node/emacs/General-Varia= bles.html#General-Variables [2] https://www.gnu.org/software/emacs/manual/html_node/emacs/Misc-Variable= s.html#Misc-Variables -- t --V4b9U9vrdWczvw78 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAl0k9x8ACgkQBcgs9XrR2kY37wCfbDVn0P1CwSvlsOe+IWS/tAiF Hz8An1C7C468+cNbdc/xg3EhnZIYW5Yl =rc7I -----END PGP SIGNATURE----- --V4b9U9vrdWczvw78--