From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Antero Mejr via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61901: 30.0.50; [PATCH v3] Add safe-local-variable-directories variable. Date: Thu, 11 May 2023 17:49:50 +0000 Message-ID: <87ednm3ght.fsf@mailbox.org> References: <87r0rpi46l.fsf@mailbox.org> <835y8z55w5.fsf@gnu.org> <87ilcy3mdt.fsf@mailbox.org> <83wn1e4zn5.fsf@gnu.org> Reply-To: Antero Mejr Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7583"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61901@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 11 19:51:20 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 1pxARk-0001lI-7W for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 May 2023 19:51:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pxARU-0002hA-GT; Thu, 11 May 2023 13:51:04 -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 1pxARS-0002gs-KG for bug-gnu-emacs@gnu.org; Thu, 11 May 2023 13:51:02 -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 1pxARS-0003pN-CD for bug-gnu-emacs@gnu.org; Thu, 11 May 2023 13:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pxARS-0008TM-2C for bug-gnu-emacs@gnu.org; Thu, 11 May 2023 13:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Antero Mejr Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 May 2023 17:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61901 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61901-submit@debbugs.gnu.org id=B61901.168382740432357 (code B ref 61901); Thu, 11 May 2023 17:51:02 +0000 Original-Received: (at 61901) by debbugs.gnu.org; 11 May 2023 17:50:04 +0000 Original-Received: from localhost ([127.0.0.1]:53300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxAQW-0008Pm-9W for submit@debbugs.gnu.org; Thu, 11 May 2023 13:50:04 -0400 Original-Received: from mout-p-202.mailbox.org ([80.241.56.172]:48690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxAQU-0008PB-FL for 61901@debbugs.gnu.org; Thu, 11 May 2023 13:50:03 -0400 Original-Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4QHKD21ZXRz9skn; Thu, 11 May 2023 19:49:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1683827394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CzhNe7DzxjXN+gHJHRT01UKpTB1h6zBtNXrbeNxs5Go=; b=ka6RwVBD0Is1Lld6hsG1oxAiLNoH3RYABx0HC9RElP8kbTum9poV6YW1tLQNmCBS/TBOAw Qwxno61clhkwGMz6Po7fvP6eyso6JUAjPaBA7gr3gEBdTa5jSjUokfIBmnGNYCRw87AWuX 3/q8JASUudRl1Sl7b+gfua+GbjLNnYnob8Gp2Dazn0/Az3miBECgW2zJ7tq8b5aBdA9cNO nOwqPzQm+oa5M4z6MAdBU9aK5eYdAGWmBgq1D8/W7rG3u0uPUYVLHC3A37a2tJ/y4JPaIb zjhnFX6CbOvbER6HaqhrHLiYn5HHaiZux9kfPnBizKwh1mg+KkF7ee3d+eWh9g== In-Reply-To: <83wn1e4zn5.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 11 May 2023 19:10:54 +0300") X-MBO-RS-META: mt7ep1hs5d5ny9jf547pwg13nhzx9gnk X-MBO-RS-ID: 5bd48b11224ec8cd571 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:261584 Archived-At: Eli Zaretskii writes: >> diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi >> index b3a8cd8110c..28deddf985d 100644 >> --- a/doc/lispref/variables.texi >> +++ b/doc/lispref/variables.texi >> @@ -1986,7 +1986,7 @@ fully-expanded absolute file names that end in a >> directory separator >> character. They may also be remote directories if the variable >> @code{enable-remote-dir-locals} is set non-@code{nil}. Directories in >> this list are matched case-sensitively, even if the filesystem is >> -case-sensitive. >> +case-insensitive. >> @end defvar > > This actually means that I misunderstood the code. Now that I see the > truth, why is it a good idea to compare directories case-sensitively > when the filesystem is not? That's not something users will expect. What if a directory's case sensitivity changes so that it previously did not match, but now does? This could happen with Windows per-directory case sensitivity modifications, mounted disks, or remote paths. To accurately assess if a directory name matches with possible case-sensitivity, the process would be: 1. check the case-sensitivity of the filesystem 2. If case insensitive, check the case-sensitivity of each subdirectory (using Windows queryCaseSensitiveInfo if applicable) 3. map over the components of the directory name, checking each subdirectory with the correct case-sensitivity setting That logic would be difficult for users to reason about, so for features with security considerations like this I think it's better to err on the side of safety and simplicity even if the behavior is stricter than expected.