GNU bug report logs - #45540
27.1; symbolic links crash dired

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Devon Sean McCullough <Emacs-hacker2018@HIDDEN>; Keywords: moreinfo; dated Tue, 29 Dec 2020 21:55:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 45540 <at> debbugs.gnu.org:


Received: (at 45540) by debbugs.gnu.org; 23 Jan 2021 22:48:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 23 17:48:16 2021
Received: from localhost ([127.0.0.1]:35562 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l3RhY-0001g6-MT
	for submit <at> debbugs.gnu.org; Sat, 23 Jan 2021 17:48:16 -0500
Received: from quimby.gnus.org ([95.216.78.240]:56768)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1l3RhW-0001fs-1W
 for 45540 <at> debbugs.gnu.org; Sat, 23 Jan 2021 17:48:15 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=NR6fBmYWTDzQez8BzA4MeEoCYc3uwruqQ9TBeX9zBQk=; b=jsXy89JsVJRTI5V4QCA23QP3sA
 2ce6Qi/qtPbwRL6A4vJYpPNdVMSTfKaze05W9h9nZF+YMWXwYK8CeMjHYEeLFF66Jii3v84GvzjlU
 gbt4BBE5GCncB51lznyrd75YQy9Ipx0Wh6/AdQw+4eDTGwyn1uN+X4zo68oU++1Vx0xs=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1l3RhL-0006KP-TG; Sat, 23 Jan 2021 23:48:07 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Devon Sean McCullough <Emacs-hacker2018@HIDDEN>
Subject: Re: bug#45540: 27.1; symbolic links crash dired
References: <fed2beae-7a9a-1e7a-f840-c94145d2005d@HIDDEN>
 <875z4kq84p.fsf@HIDDEN>
X-Now-Playing: Arthur Russell's _Sketches For World Of Echo (June 25 1984
 Live At Ei)_: "Let's Go Swimming (Live 6-24-84)"
Date: Sat, 23 Jan 2021 23:48:02 +0100
In-Reply-To: <875z4kq84p.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 30 Dec 2020 04:34:46 +0100")
Message-ID: <87a6szs21p.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Lars Ingebrigtsen <larsi@HIDDEN> writes: > Devon Sean
 McCullough
 <Emacs-hacker2018@HIDDEN> writes: > >> Here's a fix. I did NOT check this
 carefully. >> Dired crashes when (< (length file-name) (length root)) > >
 The patch looks reasonable [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 45540
Cc: 45540 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Devon Sean McCullough <Emacs-hacker2018@HIDDEN> writes:
>
>> Here's a fix.  I did NOT check this carefully.
>> Dired crashes when (< (length file-name) (length root))
>
> The patch looks reasonable -- but do you have a test case that
> reproduces this bug (starting from "emacs -Q") so that we can verify the
> bug and the fix?

I tried various link scenarios to come up with a case where file-name
was shorter than root, and I was unable to.  Do you have a test case for
such a setup?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45540; Package emacs. Full text available.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 45540 <at> debbugs.gnu.org:


Received: (at 45540) by debbugs.gnu.org; 30 Dec 2020 03:34:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 29 22:34:58 2020
Received: from localhost ([127.0.0.1]:40660 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kuSGH-0001uH-QE
	for submit <at> debbugs.gnu.org; Tue, 29 Dec 2020 22:34:58 -0500
Received: from quimby.gnus.org ([95.216.78.240]:60852)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kuSGG-0001u5-1I
 for 45540 <at> debbugs.gnu.org; Tue, 29 Dec 2020 22:34:56 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=nBXXH15JHLqC5Df6n+oRn92eVrxiT3lvtEb0R/ws0dU=; b=eOpc/FbTIM/HZBg72Gwg7tmAO5
 fvC9/wCrdSuA4QppQC4uaUMzFZST0BS4Tw4TgI06eIyH6iXLDsUWxRGcYdJG28RT1wHGn+XXGlmQv
 rkZ2I191qtz1RJMliDicWUy+g60F1C2R4dc75luiiHyxhFKTBnOF7motZ8LAAiQk1w3g=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1kuSG7-0001Wm-Cg; Wed, 30 Dec 2020 04:34:49 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Devon Sean McCullough <Emacs-hacker2018@HIDDEN>
Subject: Re: bug#45540: 27.1; symbolic links crash dired
References: <fed2beae-7a9a-1e7a-f840-c94145d2005d@HIDDEN>
X-Now-Playing: Simon & Garfunkel's _The Concert In Central Park_: "Me And
 Julio Down By The Schoolyard"
Date: Wed, 30 Dec 2020 04:34:46 +0100
In-Reply-To: <fed2beae-7a9a-1e7a-f840-c94145d2005d@HIDDEN> (Devon Sean
 McCullough's message of "Tue, 29 Dec 2020 16:54:15 -0500")
Message-ID: <875z4kq84p.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Devon Sean McCullough <Emacs-hacker2018@HIDDEN> writes:
 > Here's a fix. I did NOT check this carefully. > Dired crashes when (<
 (length
 file-name) (length root)) The patch looks reasonable -- but do you have a
 test case that reproduces this bug (starting from "emacs -Q") so that we
 can verify the bug and the fix? 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 45540
Cc: 45540 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Devon Sean McCullough <Emacs-hacker2018@HIDDEN> writes:

> Here's a fix.  I did NOT check this carefully.
> Dired crashes when (< (length file-name) (length root))

The patch looks reasonable -- but do you have a test case that
reproduces this bug (starting from "emacs -Q") so that we can verify the
bug and the fix?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45540; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Dec 2020 21:54:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 29 16:54:34 2020
Received: from localhost ([127.0.0.1]:40407 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kuMwr-0006Am-Tf
	for submit <at> debbugs.gnu.org; Tue, 29 Dec 2020 16:54:34 -0500
Received: from lists.gnu.org ([209.51.188.17]:48016)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <emacs-hacker2018@HIDDEN>) id 1kuMwp-0006Ad-9w
 for submit <at> debbugs.gnu.org; Tue, 29 Dec 2020 16:54:32 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:41844)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <emacs-hacker2018@HIDDEN>)
 id 1kuMwo-0005tS-Vn
 for bug-gnu-emacs@HIDDEN; Tue, 29 Dec 2020 16:54:31 -0500
Received: from gateway23.websitewelcome.com ([192.185.49.180]:42617)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <emacs-hacker2018@HIDDEN>)
 id 1kuMwn-0006b2-09
 for bug-gnu-emacs@HIDDEN; Tue, 29 Dec 2020 16:54:30 -0500
Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5])
 by gateway23.websitewelcome.com (Postfix) with ESMTP id 2A9444555
 for <bug-gnu-emacs@HIDDEN>; Tue, 29 Dec 2020 15:54:16 -0600 (CST)
Received: from leaf.websitewelcome.com ([192.185.82.99]) by cmsmtp with SMTP
 id uMwakeEAjnPrxuMwakqmzZ; Tue, 29 Dec 2020 15:54:16 -0600
X-Authority-Reason: nr=8
Received: from pool-72-83-171-228.washdc.east.verizon.net
 ([72.83.171.228]:56315 helo=[192.168.1.165])
 by leaf.websitewelcome.com with esmtpsa (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <Emacs-hacker2018@HIDDEN>) id 1kuMwa-000Pv8-0g
 for bug-gnu-emacs@HIDDEN; Tue, 29 Dec 2020 15:54:16 -0600
To: bug-gnu-emacs@HIDDEN
From: Devon Sean McCullough <Emacs-hacker2018@HIDDEN>
Subject: 27.1; symbolic links crash dired
Message-ID: <fed2beae-7a9a-1e7a-f840-c94145d2005d@HIDDEN>
Date: Tue, 29 Dec 2020 16:54:15 -0500
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
 Gecko/20100101 Thunderbird/78.6.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - leaf.websitewelcome.com
X-AntiAbuse: Original Domain - gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - jovi.net
X-BWhitelist: no
X-Source-IP: 72.83.171.228
X-Source-L: No
X-Exim-ID: 1kuMwa-000Pv8-0g
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: pool-72-83-171-228.washdc.east.verizon.net ([192.168.1.165])
 [72.83.171.228]:56315
X-Source-Auth: devon2011@HIDDEN
X-Email-Count: 1
X-Source-Cap: am92aW5ldDtkZXZvbjtsZWFmLndlYnNpdGV3ZWxjb21lLmNvbQ==
X-Local-Domain: yes
Received-SPF: pass client-ip=192.185.49.180;
 envelope-from=emacs-hacker2018@HIDDEN; helo=gateway23.websitewelcome.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001,
 RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

Here's a fix.  I did NOT check this carefully.
Dired crashes when (< (length file-name) (length root))

diff -aBbdu --label 
/Applications/Emacs-27.1.app/Contents/Resources/lisp/files.el.gz --label 
\#\<buffer\ files.el.gz\> 
/var/folders/jv/9lctn91j0xqfv3f2kxc1lxx80000gn/T/jka-comtv7p5N 
/var/folders/jv/9lctn91j0xqfv3f2kxc1lxx80000gn/T/buffer-content-fatCkh
--- /Applications/Emacs-27.1.app/Contents/Resources/lisp/files.el.gz
+++ #<buffer files.el.gz>
@@ -4019,10 +4019,9 @@
    (let* ((file-name (or (buffer-file-name)
  			;; Handle non-file buffers, too.
  			(expand-file-name default-directory)))
-	 (sub-file-name (if (and file-name
+	 (sub-file-name (when (and file-name
                                   (file-name-absolute-p file-name))
-                            ;; FIXME: Why not use file-relative-name?
-			    (substring file-name (length root)))))
+			  (file-relative-name file-name root))))
      (condition-case err
          (dolist (entry class-variables variables)
            (let ((key (car entry)))

Diff finished.  Tue Dec 29 16:42:36 2020




Acknowledgement sent to Devon Sean McCullough <Emacs-hacker2018@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#45540; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 23 Jan 2021 23:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.