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#74627: .dir-locals.el warning messages are confusing Date: Wed, 11 Dec 2024 17:00:11 +0200 Message-ID: <864j3a464k.fsf@gnu.org> References: <86a5daxydw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15350"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, 74627@debbugs.gnu.org To: =?UTF-8?Q?Bj=C3=B6rn?= Lindqvist Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 11 16:01:33 2024 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 1tLODT-0003oE-Jf for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Dec 2024 16:01:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLOD3-0005AX-NI; Wed, 11 Dec 2024 10:01:05 -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 1tLOD1-0005AM-A5 for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 10:01:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLOD0-0005pE-OG for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 10:01:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=QHyksHBRo5eRxmmw2zZh+PrcOL0GSmRrjOKGm/XHTOA=; b=BW1KqQbbyf1KbN3poqGS8HzexgEJTc4cq6V/BXGuEwpScwLCJf6Or9HzSzODA9drkParFTehBIHhT5wEUqIvrl5nuv8tCxdZVE08U0+haCrl+C7bgVNUEPRDVJN2t+H1+UHv/h3D+65Bn/fQGL47AIpVE36mTbYLKfIod/mkZLhzQIjWxiRHCUHAvXptGFbLAIRHcbDBth1t4T8UATN2DPVKhHwWts/5OAWDpfEB8hzca9gLXZcn5DtIAdQmgNOA1udYFDMOCbqEEqKMdSrNJgq6J7mP3JYxjb4lTv0zrFhiqNJqcdMEoI0Pq+q2Gj9ToKbsebpR1VZbmbxiZJofgw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLOD0-0005Xy-9l for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 10:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Dec 2024 15:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74627 X-GNU-PR-Package: emacs Original-Received: via spool by 74627-submit@debbugs.gnu.org id=B74627.173392922521252 (code B ref 74627); Wed, 11 Dec 2024 15:01:02 +0000 Original-Received: (at 74627) by debbugs.gnu.org; 11 Dec 2024 15:00:25 +0000 Original-Received: from localhost ([127.0.0.1]:35669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLOCO-0005Wi-W9 for submit@debbugs.gnu.org; Wed, 11 Dec 2024 10:00:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLOCM-0005TY-NN for 74627@debbugs.gnu.org; Wed, 11 Dec 2024 10:00:23 -0500 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 1tLOCH-0005cK-B8; Wed, 11 Dec 2024 10:00:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=QHyksHBRo5eRxmmw2zZh+PrcOL0GSmRrjOKGm/XHTOA=; b=jX2cvTang+B0N+DrQKWE Nyg6F0itZfZp67FAAFpXD4Q4waMGsglLUle1+TaNaU7xmxRtgYXmWTvSYH0nrcW8LwevWT1V8wY28 zKLSnxEZa9loS/GlJn5WSoSg84nHmk//L0R3TxEuucvfzZsbkL/ypqKugIKL1ZzvofNvET+2+k/f0 ED7utszYlRU1wAQQQnr06pNz0jq2vwvm22nOkl2vX1M3QDX80v+NzeEKIZ/QV2YdSUJ0gwmtWG1f7 3XUi0a8cCCb4BAC9XsbodQMFGTp19YxTIYfejG0ECwZj3uWlW55YanGBf8/p5I57JQ+ypf9NAsTHY Xfb1bNPX/+pUeQ==; In-Reply-To: (message from =?UTF-8?Q?Bj=C3=B6rn?= Lindqvist on Wed, 11 Dec 2024 09:18:33 +0100) 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:296832 Archived-At: > From: Björn Lindqvist > Date: Wed, 11 Dec 2024 09:18:33 +0100 > Cc: Stefan Monnier , 74627@debbugs.gnu.org > > Den tors 5 dec. 2024 kl 10:38 skrev Eli Zaretskii : > > > > Warnings about potential security issues should be easy to understand, > > > but the warnings produced by .dir-locals.el are not. When I open a > > > file in the Emacs source code it shows: > > > > > > The local variables list in /home/bjourne/p/emacs/ > > > or .dir-locals.el contains values that may not be safe (*). > > > > > > Why does it say "or"? > > > > Because that function is called with a single flag argument which > > could be set non-nil either due to unsafe file-local variables or due > > to .dir-locals.el. > > So there are multiple sources of unsafe variables, but the function > responsible for formulating the error message doesn't know what the > source is? Yes, that's my reading of the code. > Regardless of whether my guess is correct, the text should > not refer to the local variables in "/home/bjourne/p/emacs/" because > there can be no unsafe variables in directories (only files). Well, we consider variables in .dir-locals.el as belonging to the directory in which it lives. > > > What does the asterisk (*) mean? > > > > It means the variables marked with the asterisk in the list of > > below this text could be unsafe. > > Aha. Emacs lists both safe and unsafe variables. Why does it list the > safe ones? The warning would be much clearer if the safe variables > were omitted since they don't matter. That would make it clear what > variables "!" and "i" choices apply or mark as safe/ignored. I can only guess: showing all of them lets you see the problematic one in context.