From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KH9aJllPTWNMKwEAbAwnHQ (envelope-from ) for ; Mon, 17 Oct 2022 14:49:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mKQuJllPTWO5iAAAauVa8A (envelope-from ) for ; Mon, 17 Oct 2022 14:49:29 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4BE9E1D37E for ; Mon, 17 Oct 2022 14:49:29 +0200 (CEST) Received: from localhost ([::1]:36376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okPYe-0005ud-7M for larch@yhetil.org; Mon, 17 Oct 2022 08:49:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okPW1-0005sR-0j for emacs-orgmode@gnu.org; Mon, 17 Oct 2022 08:46:48 -0400 Received: from mout01.posteo.de ([185.67.36.65]:54231) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okPVu-0003pK-9F for emacs-orgmode@gnu.org; Mon, 17 Oct 2022 08:46:44 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BBAEB240026 for ; Mon, 17 Oct 2022 14:46:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1666010793; bh=xosw2cb0ubqTiyU5WJZysVBr4vS4L6hqenW1akKutuA=; h=From:To:Cc:Subject:Date:From; b=BXYpw/NaaqW6T6dj/TfDKCyYvn+iQcJKgkL8jbliu5PyILrJysriw0VuyR3Ibu092 oOKDRNyhbN8J/YkBtO4gu1ssRvL2n+8xuxK4VsRllKfjAqMnJO3z2529VpF9+c4QUK l2RaoyHtu/BAXWsgwe4RPfOuqj+QgtEdQAl6lfHWCwOYjCnAqOkoPChdpzYnpBf8Cx z0p7ME/zF2GG1nUO4ruDxKs1qitTaMdXNdPIuHPJNS62fEw4U8N5c8vy7xWtjQnxF0 yl666UE2LHQU6nHJxRZ900rXsxel9quee5k12Tfpx/uLPJIRIMH0ejaM+2bzdNogre hOlXKZeTEHgbQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MrcF32KyQz6tnW; Mon, 17 Oct 2022 14:46:30 +0200 (CEST) From: Ihor Radchenko To: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= Cc: emacs-orgmode@gnu.org Subject: [PATCH] Re: [BUG] Make org-html-htmlize-output-type safe [9.5.2 (release_9.5.2-9-g7ba24c @ /Users/salutis/src/emacs/nextstep/Emacs.app/Contents/Resources/lisp/org/)] In-Reply-To: References: Date: Mon, 17 Oct 2022 12:47:18 +0000 Message-ID: <87k04ypqg9.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666010969; h=from:from:sender:sender: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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=fo7tftoMsVVxEYOKkfXKovBt+tLmMBFug8vFD6N5b2w=; b=n4Ggwx8wxYKf4AXxhm2ZGkNGgXahedwvvlbWcvp/uoboip6SgJ2AML0ltn1dzbLXbWQzRS oR0gjTEAxV07xdtHC2fBdElmT9grr7siu3kBMJgyXXV7kKVwVQl5RWWXIHgmEXGKjpT8/9 HRct4ZG0+Rurw1LTshK4GN9svBjIMyospaVjDWdwoco9VRnltTZgJ8bkFmC67Q8N3268G7 xmtkDKq35uzxur9nXDrSb2SNaK9jgDvOgbe6HrIZvDEFfb8bGG+eVxAiYKbI9IZEHS8dx1 4PByHaGjdEtVD7ezEi4rcZjpkJzO1bc4o1P/TiLNtC+UShZYImlyP/KWAVZuMw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666010969; a=rsa-sha256; cv=none; b=rmeKyf/h7myEWCdHHLdVS5mhSlkpecJ/MtZihE/ReRK+AjjWZxrsIUQI+PM1ylJVddqP3S cD18xSbjI2EsD7mG4e7/wDuXiX4eD2nhdyDMaoNS5ViIl23aaQFLqJh/FNfchwpSyzhjPb iviQqg4OiemojcjGrTXahEtbO5Y+xB2d/gU8/PYzQnB8rsYcgIbaO+P/BFCoZMfJR+s1yU q53xr9V+naqh8tMflmOrzcwlcdXgtK9rEmYw9cSx9HOM5QrL8zkNrIEovfmK6phaB67wYk lXN1nduLgNJLAA1qoHczV86IgxKzptlzICajJKzPENPHsn/Ll/qvuiylF5Vagw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="BXYpw/Na"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.42 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="BXYpw/Na"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 4BE9E1D37E X-Spam-Score: -3.42 X-Migadu-Scanner: scn1.migadu.com X-TUID: /D5MY3nzqXqt --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Rudolf Adamkovi=C4=8D writes: > In some of my notes, I have the following line: > > # -*- org-html-htmlize-output-type: nil -*- > > Every time I open such a file, Emacs wants me to confirm that doing so > poses no security risk. Could we perhaps make this variable safe? Can be done. Like in the attached patch. However, note that Emacs will still want about buffer-local setting if ox-html is not loaded. The same will happen with any other "safe" variable defined in Org libraries that are not loaded by default. I am wondering if we should add autoload cookies to such variables. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-org-html-htmlize-output-type-Mark-safe-as-buffer-loc.patch Content-Transfer-Encoding: quoted-printable >From 5779ce5f5a05aa4e4f76d85eae1c1e324a77dea2 Mon Sep 17 00:00:00 2001 Message-Id: <5779ce5f5a05aa4e4f76d85eae1c1e324a77dea2.1666010682.git.yantar= 92@posteo.net> From: Ihor Radchenko Date: Mon, 17 Oct 2022 20:43:59 +0800 Subject: [PATCH] org-html-htmlize-output-type: Mark safe as buffer-local MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * lisp/ox-html.el (org-html-htmlize-output-type): This variable is safe to set buffer-locally as a symbol. Reported-by: Rudolf Adamkovi=C4=8D Link: https://orgmode.org/list/m28ruxklo5.fsf@me.com --- lisp/ox-html.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index cad06aebf..c34711d1e 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -897,7 +897,8 @@ (defcustom org-html-htmlize-output-type 'inline-css in all modes you want. Then, use the command `\\[org-html-htmlize-generate-css]' to extract class definitions." :group 'org-export-html - :type '(choice (const css) (const inline-css) (const nil))) + :type '(choice (const css) (const inline-css) (const nil)) + :safe #'symbolp) =20 (defcustom org-html-htmlize-font-prefix "org-" "The prefix for CSS class names for htmlize font specifications." --=20 2.35.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--