GNU bug report logs - #50944
malformed :safe entry in several defcustoms

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Fri, 1 Oct 2021 15:43:02 UTC

Severity: normal

Found in version 28.0.60

Fixed in version 28.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50944 in the body.
You can then email your comments to 50944 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#50944; Package emacs. (Fri, 01 Oct 2021 15:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Glenn Morris <rgm <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 01 Oct 2021 15:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: submit <at> debbugs.gnu.org
Subject: malformed :safe entry in several defcustoms
Date: Fri, 01 Oct 2021 11:41:56 -0400
Package: emacs
Version: 28.0.60

Around 30 defcustoms (mostly in Org) state ":safe t", which is incorrect.
The safe-local-variable property should be a predicate function of one
argument.




bug marked as fixed in version 28.1, send any further explanations to 50944 <at> debbugs.gnu.org and Glenn Morris <rgm <at> gnu.org> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 02 Oct 2021 18:02:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50944; Package emacs. (Sat, 02 Oct 2021 20:02:01 GMT) Full text and rfc822 format available.

Message #10 received at 50944 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 50944 <at> debbugs.gnu.org
Subject: Re: bug#50944: malformed :safe entry in several defcustoms
Date: Sat, 02 Oct 2021 16:01:41 -0400
> Around 30 defcustoms (mostly in Org) state ":safe t", which is incorrect.
> The safe-local-variable property should be a predicate function of one
> argument.

The secondary bug here is that those errors should be flagged with
a warning.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50944; Package emacs. (Sun, 03 Oct 2021 23:53:02 GMT) Full text and rfc822 format available.

Message #13 received at 50944 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 50944 <at> debbugs.gnu.org
Subject: Re: bug#50944: malformed :safe entry in several defcustoms
Date: Sun, 03 Oct 2021 19:52:45 -0400
Stefan Monnier wrote:

>> Around 30 defcustoms (mostly in Org) state ":safe t", which is incorrect.
>> The safe-local-variable property should be a predicate function of one
>> argument.
>
> The secondary bug here is that those errors should be flagged with
> a warning.

Run-time warning seems easy:

--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4042,7 +4042,7 @@ It is safe if any of these conditions are met:
    evaluates to a non-nil value with VAL as an argument."
   (or (member (cons sym val) safe-local-variable-values)
       (let ((safep (get sym 'safe-local-variable)))
-        (and (functionp safep)
+        (and safep
              ;; If the function signals an error, that means it
              ;; can't assure us that the value is safe.
              (with-demoted-errors (funcall safep val))))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50944; Package emacs. (Mon, 04 Oct 2021 09:33:01 GMT) Full text and rfc822 format available.

Message #16 received at 50944 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 50944 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#50944: malformed :safe entry in several defcustoms
Date: Mon, 04 Oct 2021 11:32:29 +0200
Glenn Morris <rgm <at> gnu.org> writes:

>> The secondary bug here is that those errors should be flagged with
>> a warning.
>
> Run-time warning seems easy:

A compile-time warning would be nicer, I think.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50944; Package emacs. (Mon, 04 Oct 2021 15:28:01 GMT) Full text and rfc822 format available.

Message #19 received at 50944 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 50944 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#50944: malformed :safe entry in several defcustoms
Date: Mon, 04 Oct 2021 11:27:04 -0400
Lars Ingebrigtsen wrote:

>> Run-time warning seems easy:
>
> A compile-time warning would be nicer, I think.

Please make a separate bug report for this (this one is closed). Or a patch. :)

To be explicit, the failure mode causes the variable to not be
considered safe, so it's not an important issue, and should be obvious
if anyone actually tests their :safe property.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 02 Nov 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 169 days ago.

Previous Next


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