From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#44128: [feature/native-comp] Date: Fri, 16 Apr 2021 09:52:59 +1200 Message-ID: <39a1a9f8-7ea5-b476-85b7-6639ace8d7d5@orcon.net.nz> References: <87eelri6l8.fsf@bernoul.li> <574a5ce8-59da-6329-3f94-49a94496f7a9@orcon.net.nz> <834kg8yr7u.fsf@gnu.org> <710dd7f3-c058-646d-be97-61aaccc076c0@orcon.net.nz> <83r1jby7su.fsf@gnu.org> <1c7af255-8294-39a3-8a7c-8ec938f81b85@orcon.net.nz> <83mttzy5gm.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="32336"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: akrl@sdf.org, jonas@bernoul.li, 44128@debbugs.gnu.org, eli@gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 15 23:58:55 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 1lXA0k-0008FX-No for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Apr 2021 23:58:54 +0200 Original-Received: from localhost ([::1]:48020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXA0j-0007mG-NJ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Apr 2021 17:58:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX9w2-0003Na-1X for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2021 17:54:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56100) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lX9w1-0002x6-LE for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2021 17:54:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lX9w1-0003HU-K1 for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2021 17:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Apr 2021 21:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44128 X-GNU-PR-Package: emacs Original-Received: via spool by 44128-submit@debbugs.gnu.org id=B44128.161852358612545 (code B ref 44128); Thu, 15 Apr 2021 21:54:01 +0000 Original-Received: (at 44128) by debbugs.gnu.org; 15 Apr 2021 21:53:06 +0000 Original-Received: from localhost ([127.0.0.1]:39413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lX9v7-0003GH-RS for submit@debbugs.gnu.org; Thu, 15 Apr 2021 17:53:06 -0400 Original-Received: from smtp-2.orcon.net.nz ([60.234.4.43]:35163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lX9v5-0003G2-F5 for 44128@debbugs.gnu.org; Thu, 15 Apr 2021 17:53:04 -0400 Original-Received: from [101.53.216.162] (port=53235 helo=[192.168.20.103]) by smtp-2.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1lX9v1-0004t0-H4; Fri, 16 Apr 2021 09:52:59 +1200 In-Reply-To: <83mttzy5gm.fsf@gnu.org> Content-Language: en-GB X-GeoIP: NZ X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- 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:204101 Archived-At: On 16/04/21 2:42 am, Eli Zaretskii wrote: >> $ emacs --version >> emacs: could not resolve realpath of "emacs": No such file or directory >> $ touch emacs >> $ emacs --version >> emacs: /tmp/../native-lisp/28.0.50-abd7aa58/preloaded/window-0d1b8b93-581f9fcd.eln: cannot open shared object file: No such file or directory > > That's Emacs trying to see if it is run uninstalled, so I see no > problem here. What exactly do you think is wrong with this, again? The first problem is that it's currently not possible to start emacs if you're in a directory which contains a file or directory called 'emacs'. I think that's Bad, and it will undoubtedly be reported as a bug by other people for as long as that persisted. It certainly doesn't happen with non-native-comp builds. The second problem is that this type of behaviour feels rather like something you mentioned earlier: having "." in your PATH, which is widely considered a bad idea. I expect that exploits are unlikely (e.g. arranging for a malicious native-lisp/28.0.50-abd7aa58/preloaded/window-0d1b8b93-581f9fcd.eln to exist is probably a lot of work), but I think Emacs should not behave differently depending on where you are when you start it. In future, once this feature is merged, many people will have multiple local installs of various native-comp-enabled versions, and might be moving between them and/or working on them. If Emacs then tried to run code for the version in the CWD even if the executable that was invoked was for a different install, that would be very surprising (and potentially very difficult for the user to notice). I do see the hashes in the filenames, so maybe that scenario is already avoided, if the eln filenames are unique to the version of Emacs? This "looking in the CWD" behaviour still feels wrong to me, though. Are there other existing ways in which Emacs changes its behaviour based on the CWD? -Phil