From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#64102: 28.2; fails to find pathname with a sub dir as symlink and with parent dir ('..') Date: Fri, 16 Jun 2023 10:11:49 +0300 Message-ID: <83352rubii.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21300"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64102@debbugs.gnu.org To: Jacob Burckhardt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 16 09:12:39 2023 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 1qA3dO-0005PP-8c for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Jun 2023 09:12:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qA3cr-0002pq-D5; Fri, 16 Jun 2023 03:12:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qA3cp-0002Zo-3g for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2023 03:12:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qA3co-0006x6-D6 for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2023 03:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qA3co-0000NL-8G for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2023 03:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Jun 2023 07:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64102 X-GNU-PR-Package: emacs Original-Received: via spool by 64102-submit@debbugs.gnu.org id=B64102.16868994951387 (code B ref 64102); Fri, 16 Jun 2023 07:12:02 +0000 Original-Received: (at 64102) by debbugs.gnu.org; 16 Jun 2023 07:11:35 +0000 Original-Received: from localhost ([127.0.0.1]:48534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qA3cM-0000MJ-FL for submit@debbugs.gnu.org; Fri, 16 Jun 2023 03:11:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qA3cJ-0000M4-Ir for 64102@debbugs.gnu.org; Fri, 16 Jun 2023 03:11:32 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qA3cD-0006r5-SJ; Fri, 16 Jun 2023 03:11:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=0fw4wql5iR+w78SZ1hxckeAtWRil/vFhdvQqGH3CKg4=; b=nUsACs4ryfIC on3CeSBBi93fJMEL3bo5KcZCt89eAs8SNpFXfwxgbdwp/IH88Vu4VGvbS26lZbNTBY5IESOxqv6Ie L6HBioMi3O5ZG8De1Wko4YrPUixeSn2mVGLIIxBqsU9C28jHcZves7Yx2AMjcuVHMC+RrhiT6APbI Y2iOMdGjVdmOR6OWPlPcpGXfJppBAS0xSZN7UgKlSbGn7c0JOzzL/r5Buw//dpPpmLwRRfwEXiw1t uGXEdRgSMvaBf4RW2spDDHKl+fKz3ouL/f9gxOBUyJjE0CZMLlz9Z7gHE/sMY/oEheJuHFU9GdBut PEgaSCCkSb4zhMX76x1UBQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qA3cD-0008J9-C7; Fri, 16 Jun 2023 03:11:25 -0400 In-Reply-To: (bug-gnu-emacs@gnu.org) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263458 Archived-At: > Date: Thu, 15 Jun 2023 22:25:56 +0000 > msip_labels: > From: Jacob Burckhardt via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Reproduce the bug by running this: > > mkdir -p /tmp/usr2/lib/gcc/x86_64-linux-gnu/12 > mkdir /tmp/usr2/include > echo symbolic link test > /tmp/usr2/include/test.h > \ln -s usr2/lib /tmp/lib2 > cat /tmp/lib2/gcc/x86_64-linux-gnu/12/../../../../include/test.h > emacs -q /tmp/lib2/gcc/x86_64-linux-gnu/12/../../../../include/test.h > > Emacs failed to display the content of that file in a buffer. Since the above cat command shows the contents, Emacs should be able to show it as well. The following bug is similar and includes some explanations that also apply to my bug. > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8035 > > Note that the following code succeeds. You might consider using code like this to fix the bug: > > (find-file (file-truename "/tmp/lib2/gcc/x86_64-linux-gnu/12/../../../../include/test.h")) This would mean expand-file-name would need to call file-truename to resolve such tricky symlinks, which I think is not reasonable. We never did that, AFAICT, and the code in find-file-noselect that begins with expand-file-name on the argument FILENAME has been there since 1992.