GNU bug report logs - #74627
.dir-locals.el warning messages are confusing

Previous Next

Package: emacs;

Reported by: Björn Lindqvist <bjourne <at> gmail.com>

Date: Sat, 30 Nov 2024 17:21:01 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Björn Lindqvist <bjourne <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 74627 <at> debbugs.gnu.org
Subject: bug#74627: .dir-locals.el warning messages are confusing
Date: Wed, 11 Dec 2024 09:18:33 +0100
Hello Eli,

Den tors 5 dec. 2024 kl 10:38 skrev Eli Zaretskii <eliz <at> gnu.org>:

> > 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? 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).

> > 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.


--
mvh/best regards Björn Lindqvist




This bug report was last modified 167 days ago.

Previous Next


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