From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#60943: 28.2; =?UTF-8?Q?=E2=80=98tramp-handle-file-regular-p=E2=80=99?= misses symlinks Date: Thu, 19 Jan 2023 14:12:24 +0100 Message-ID: <87fsc6llc7.fsf@gmx.de> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39139"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 60943@debbugs.gnu.org To: Greg Pfeil Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 19 14:13:26 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 1pIUjN-000A2Y-Dm for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Jan 2023 14:13:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIUj2-0001hi-Lo; Thu, 19 Jan 2023 08:13:04 -0500 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 1pIUj0-0001gb-9d for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2023 08:13:02 -0500 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 1pIUiz-0005t5-U4 for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2023 08:13:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pIUiz-0001o3-JH for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2023 08:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jan 2023 13:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60943 X-GNU-PR-Package: emacs Original-Received: via spool by 60943-submit@debbugs.gnu.org id=B60943.16741339626917 (code B ref 60943); Thu, 19 Jan 2023 13:13:01 +0000 Original-Received: (at 60943) by debbugs.gnu.org; 19 Jan 2023 13:12:42 +0000 Original-Received: from localhost ([127.0.0.1]:42877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIUif-0001nV-P9 for submit@debbugs.gnu.org; Thu, 19 Jan 2023 08:12:42 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:60729) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIUid-0001nH-Ix for 60943@debbugs.gnu.org; Thu, 19 Jan 2023 08:12:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1674133945; bh=vIKStWTMvsgjei2Q4ageJshlVR+CSoEkQ18+PdDNXM4=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=twE9IYq6A2cr9TitRU8F7xSTDCnOx0AoTPg+enE+f3BhV4MCaupDmbSUr1KqQy4OI TKJ9ndewmGEba1dAPIFfSBQ3NQWoiwh5YQUkpPDIvbl8C6U7zSZvWvHI1Csi0BItej 5B1ingn0v2C4ms8G0RR41T/HnZjmxXXeiG3Hpp7v46tvlpWI3oIsKfVKGIH4Sb06f3 tjv4BbX9KXvbs0Ae86/s8jY9lxHuOKHt03AMIaUlVA8TlKQO0dOcstKAn14mb6Zhfb 5Q+SJQHwAJxSb+zMC4vM9NuXvmY4a6wDvQVFq5o5Lz5P7uKbWErQq1MCxRQFs4oTmb bTzM/JKUzyxXw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.37.45]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mel81-1okGIG2wdx-00am2S; Thu, 19 Jan 2023 14:12:25 +0100 In-Reply-To: (Greg Pfeil's message of "Wed, 18 Jan 2023 23:03:34 -0700") X-Provags-ID: V03:K1:wDS9RmyqTc0wlb0PDNAlwgNCVvMAh2snX8XAHP4o3rLtRkAPnhD kfPcMlmGEpgkSVxN/Envx+iScceX1rIsgsL7WTwI9IbseuGwwc7Re0BxOFaKkXnvrwLhelm PiXxgr1pvq8gmsrOgM6jzDivI89Bl+89NOixbZlXgmGtjpHtpvu8wMgjq9C/99PBysFny8X hgadwGCFp0j7DHDPohikw== UI-OutboundReport: notjunk:1;M01:P0:eza++skCwzI=;36OzRps4+SEvpOVCXUwPycehm1c XqUraVP17SYwnYmUY+LHGU5ouPL1dHdJBTcMesLQZWv54tBj9XS5p44xXhSjyrAdx+dNQ8d69 ftaFVRkUWmDHH0Ur4S+1gKE61dsiAKYfQYiPRro3LsoFsJ1GIELJ5MKrs5a7Wj+i1JdI4waSh bbr3HYYAYhuvhBSTxRZUOZRyxihk5h/8dclpRJiHJoT3OedWLGG8gw4qmDsfZ2mU9/pChM/G5 pWutCFIeYBkV7eV7P3fQjVwtwEVftZM0ifMwCF/CRP9W9e9vqgGDXuCKUIisOQptUrW5q/4Ru 9Yk0ezsiGmCjDqXzB8mrN6uGLryt+8T13gsTCX+CyJVoBCQ2LdjLdOpPhqOD/7dNRBwwz81J3 gk0cgyGzt5N/sybxS3omwJrhoZjMm2wz4AkVUdun5RyTPPSXkD3or1N/FcFGGvC00PEe8vl1y zydbEJG9JFNVbqibYN49MoJ2AUxzOG04bBxac4fvVh0iQqpHEIwRshujpQwpAGb2O6OwoWhgB pKcGlnygrFOU6qNCrFgsBX4NzOxdyRF7fmq6ZYv4I2NMY5Qx2alvDGWAPAHnZDxex8IBcwelW JAZHoIMOyGy/jEtYoHadtpyNyAJJTZxQGxJ5JN1V/PihB9BuEWOa4Snv44WYBo4ZatLNvqMV+ ZfBuErMTue4UulfXa957vv9TeLvodZRfl0GtmglX2fMYsdMSsoQr6N2SLv3L7ehzrkeXF9Woq 8lfucA8wekdLxn5/Kul4/2kKxxbduVQ0CLcrS+Wh7nUvDwo/OXC8VOHhI2vg6bf2lt0fI3yV 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:253704 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Greg Pfeil writes: Hi Greg, > I was having an issue where .dir-locals.el on remote machines weren=E2=80= =99t getting picked up when they were a symlink. Local symlinks worked fine= , and remote non-symlinks also worked. > > Digging in, =E2=80=98tramp-handle-regular-file-p=E2=80=99 explicitly chec= ks that the first character in =E2=80=98file-attribute-mode=E2=80=99 is ?-.= However, for symlinks, that character will be ?l. > > Modifying =E2=80=98dir-locals--all-files=E2=80=99 to check > > (or (file-regular-p f) (file-symlink-p f)) > > \(which is ostensibly redundant) instead of simply > > (file-regular-p f) Indeed, there's a bug. Thanks for the report! > fixes the behavior, since TRAMP will now check with both =E2=80=98tramp-h= andle-file-regular-p=E2=80=99 and =E2=80=98tramp-handle-file-symlink-p=E2= =80=99. The correct fix is to make =E2=80=98tramp-handle-file-regular-p=E2= =80=99 match the behavior of =E2=80=98file-regular-p=E2=80=99. The appended patch fixes this. Eli, is it OK to push to the emacs-29 branch? Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable diff --git a/lisp/tramp.el b/lisp/tramp.el index 351def66..f5208cd9 100644 =2D-- a/lisp/tramp.el +++ b/lisp/tramp.el @@ -4039,7 +4039,10 @@ Let-bind it when necessary.") ;; Sometimes, `file-attributes' does not return a proper value ;; even if `file-exists-p' does. (when-let ((attr (file-attributes filename))) - (eq ?- (aref (file-attribute-modes attr) 0))))) + (cond + ((eq ?- (aref (file-attribute-modes attr) 0))) + ((eq ?l (aref (file-attribute-modes attr) 0)) + (file-regular-p (file-truename filename))))))) (defun tramp-handle-file-remote-p (filename &optional identification conn= ected) "Like `file-remote-p' for Tramp files." --=-=-=--