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.devel Subject: Re: Emacs creates emacs.d/ as root when using sudo Date: Tue, 02 Jul 2019 17:27:49 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="19675"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Stefan Monnier , emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 02 18:03:12 2019 Return-path: Envelope-to: ged-emacs-devel@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 1hiLFP-0004rq-Cc for ged-emacs-devel@m.gmane.org; Tue, 02 Jul 2019 18:03:11 +0200 Original-Received: from localhost ([::1]:54806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiLEL-0008Ns-Do for ged-emacs-devel@m.gmane.org; Tue, 02 Jul 2019 12:02:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35397) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiKhO-000390-9o for emacs-devel@gnu.org; Tue, 02 Jul 2019 11:28:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiKhN-0006oc-7R for emacs-devel@gnu.org; Tue, 02 Jul 2019 11:28:02 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:42526) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hiKhL-0006jU-8R for emacs-devel@gnu.org; Tue, 02 Jul 2019 11:28:01 -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 1hiKhB-0001Zd-Pw; Tue, 02 Jul 2019 17:27:52 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUDBAkMBQtmZXcDAwgC AwgCAQbB0ek2ExgdpXi/AAACVUlEQVQ4jU2UPW/bMBCGjwRbr5IR1CvNQVo9pDuTHtE1Bkh0rTXQ q00Y5t/ve6SUlIAk+x4d7+ul6MMwM9E4jgPJJYt/4baftXX7Wf6rZjdk2OP5/l5s0bq/KvbAbIwX 4Nxe6wd3e5m5LU+6VKd16e60m8tjBfvqaplvvII6W48g4qFc3d9OPRveTctRAmFjrY7z3hJ38Nu5 WZ6Irnd2LqPkyCaks1vuAPLeoT4exUo4wymdi7v7nggH3lZKf5xzx0GqGCmkmGCUxnh+5lymbBuA IbbX5ceUs5vyBVspijAH3FKKHHPOy5SvPQaHbymlIH5vGxiRFYu1vY4qOljoDgAjVkwxktcAGaA8 VgBzCn6k77AKWB6+byUJR8/0Iz8F5GVA+Ni2Avaent0j39l0jx6GAbBcXo7S0vQFvJ5yQ1bkESVE 386rMjmA44tUyCE0gPLGQ2l1NAdqDtJif6i1tDpsm7KBOQKIvbbo2YrGKGDFkFjBXnvwvzIQSieS JiZxqM0+j4ih6NTM6Vw/wRXAK/rZc33bAFqF6cEj/Qd6tugInQAQGUWoFVwBeroYdkAVuxVYgKOX dKVyNL0lhTIsrosRgKFjs3CopQNM8YKuq1Y8lHNY67vtAKD3JhPR1CdQIoZ1iQw3MFC7EeL7V/i8 boAw+HyT4KZptPW2OtlFgIF2DU7PFty5xYi4biJq8cA4BBTnIFvt3G072shrBZZptwE1gIQN0Bdo go+qgxecjA2c5Iy1QQFgdr647fshuv4YJa05xQF5GF5jNyEq+TKlaFjhcHv6B3alDN8Fz/EFAAAA AElFTkSuQmCC In-Reply-To: (Andreas Schwab's message of "Tue, 02 Jul 2019 08:34:44 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.231.51 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238297 Archived-At: Andreas Schwab writes: >>> $ sudo emacs /etc/default/motd-news >> >> I'd consider the above as a pilot error. >> >> If you use sudo naively like above, the $HOME is still that of the >> invoking user, > > It's really a misconfiguration of sudo if it doesn't reset HOME. But, by default, sudo doesn't (on Ubuntuish systems). Emacs is somewhat unusual among editors you might fire up as root in that it might create or write files and directories in $HOME without the user knowing, and that leads to frustration and makes "# emacs -nw" less comfortable than it could be. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no