From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.bugs Subject: bug#47298: Emacs creates HOME if it does not exist Date: Fri, 26 Mar 2021 12:18:20 +0300 Message-ID: References: <20lfag5rru.fsf@fencepost.gnu.org> <83wntz9jws.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8066"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.6 (2021-03-06) Cc: 47298@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 26 10:19:43 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lPid5-0001yZ-77 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 10:19:43 +0100 Original-Received: from localhost ([::1]:58360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPid4-0004p4-7s for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 05:19:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPicS-0004Ki-C9 for bug-gnu-emacs@gnu.org; Fri, 26 Mar 2021 05:19:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57117) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lPicR-0006LL-Bn for bug-gnu-emacs@gnu.org; Fri, 26 Mar 2021 05:19:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lPicR-00088C-8E for bug-gnu-emacs@gnu.org; Fri, 26 Mar 2021 05:19:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jean Louis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Mar 2021 09:19:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47298 X-GNU-PR-Package: emacs Original-Received: via spool by 47298-submit@debbugs.gnu.org id=B47298.161675033531221 (code B ref 47298); Fri, 26 Mar 2021 09:19:03 +0000 Original-Received: (at 47298) by debbugs.gnu.org; 26 Mar 2021 09:18:55 +0000 Original-Received: from localhost ([127.0.0.1]:40427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lPicJ-00087V-7n for submit@debbugs.gnu.org; Fri, 26 Mar 2021 05:18:55 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:53719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lPicH-00087G-RH for 47298@debbugs.gnu.org; Fri, 26 Mar 2021 05:18:54 -0400 Original-Received: from localhost ([::ffff:41.210.143.10]) (AUTH: PLAIN securesender, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000027F3C.00000000605DA6F7.00005CB8; Fri, 26 Mar 2021 02:18:46 -0700 Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:203039 Archived-At: * Glenn Morris [2021-03-25 21:29]: > Eli Zaretskii wrote: > > >> From: Glenn Morris > >> Date: Sun, 21 Mar 2021 13:40:53 -0400 > >> > >> IMO the Emacs 26.3 behaviour is correct, and Emacs should not be > >> creating HOME if it does not exist. > > > > I'm not sure I agree with you. What do other programs do in this > > situation? > > Dunno. > IMO applications should not be creating HOME, that is a system-level > responsibility. Emacs also does not create home directly, it creates its own configuration directory appended to environment variable $HOME -- which in most cases is home directory of a user, but may not be. Home directory of a user is located in /etc/passwd and $HOME is customization that users still can do for other purpose. If Emacs does not touch /etc/passwd or look for user's home there, then is not creating user's home, it is creating its configuration directory as appended to environment variable $HOME -- and other applications do exactly the same! Plethora of applications are creating their configurations in ~/.config -- so please look there, you will find all created directories. Applications are then probably finding where is the config directory by deriving it from $HOME environment variable or $XDG_CONFIG_HOME and when $XDG_CONFIG_HOME is not there it is derived maybe from XDG_CONFIG_HOME="$HOME/.config" > Missing HOME indicates either a deliberate choice, or a system-level > problem that the application should not try to fix (in most cases, it > won't even have permission to do so) but should just report. When application like Emacs runs, it does not "create home" as above explained, but it wants to create its directory for future functionality. Using $HOME environment variable is not same as user's home directory, which is defined in /etc/passwd and need not be defined in $HOME automatically -- though that is what systems do for convenience. I can enter in the system at /root point, it does not matter, $HOME is where I have permission and my files. > > And if we don't create ~/.emacs.d, how can we save user's > > customizations? > > You don't, you give a warning. Your assumption that Emacs changes or fiddles with user's home is incorrect. It works (probably, me insecure) with $HOME variable which is not equal to user's home, which is irrelevant to user's home directory! I don't agree with this quite, as I use Emacs on Lineage OS, Android OS, there are setups you do not know, and where this statement does not apply. In fact there is no specific user's directory on such systems and it depends of the access: On the same system: $ adb shell (but I am not root) condor:/ $ echo $HOME / and I have no permissions to write in that directory, obviously it is not real home, but I have $HOME. Then different SSH application would give me different $HOME. $ ssh motorolausb $ echo $HOME /data/data/com.termux/files/home which is inconvenient, so I like changing $HOME variable to /storage/emulated/0 as that is where Pictures, and Videos are located as well, makes more sense to me. > > That might mean we need to find other ways of isolating tests from > > user customizations. > > Your only alternative is to have the test machinery make a temporary but > existing HOME and ensure it is deleted afterwards. > But IMO that is a separate issue. > Even if that change is made, I still don't believe Emacs should create HOME. I think it should as all other applications follow that. Creating $HOME is not same as creating user's home directory as specified in /etc/passwd -- while similar, those things are not same, I have given you example from Lineage OS system. If the configuration directory cannot be created, no warning should be issued as user is invoking Emacs most probably to edit text and there is no need to confuse editing with configuration. When configuration cannot be saved because the directory could not be created, at the time point of not being able to save configuration, that is where warning should be issued. Jean