From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#51579: Mark variable as safe only in one file or directory Date: Tue, 2 Nov 2021 21:10:03 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18631"; mail-complaints-to="usenet@ciao.gmane.io" To: 51579@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 03 05:11:51 2021 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 1mi7cs-0004gz-Q3 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Nov 2021 05:11:50 +0100 Original-Received: from localhost ([::1]:35956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi7cr-0006hZ-QQ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Nov 2021 00:11:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi7c6-0004nc-Sd for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 00:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55292) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi7c6-0003Th-Ji for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 00:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mi7c6-0005kn-FD for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 00:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Nov 2021 04:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51579 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163591261222045 (code B ref -1); Wed, 03 Nov 2021 04:11:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Nov 2021 04:10:12 +0000 Original-Received: from localhost ([127.0.0.1]:38605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mi7bI-0005jV-7V for submit@debbugs.gnu.org; Wed, 03 Nov 2021 00:10:12 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:58988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mi7bF-0005jH-5j for submit@debbugs.gnu.org; Wed, 03 Nov 2021 00:10:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi7bD-00023D-SI for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 00:10:09 -0400 Original-Received: from mail-pj1-f44.google.com ([209.85.216.44]:56138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi7bB-0003Gg-HG for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 00:10:07 -0400 Original-Received: by mail-pj1-f44.google.com with SMTP id om14so399343pjb.5 for ; Tue, 02 Nov 2021 21:10:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:date:message-id:subject:to :content-transfer-encoding; bh=uGWouHPiryhgukqU/RWfHhTWhm4lp0A8eISLc/y8s/w=; b=R1H0Qzc8gH8mjtGlvMWku6rH0mG6YSXDHBw67oVNvuO9MjKGJU+XLDjAxoj70lGVTx d/EsdV7bDuOofYV+uWVuzs2FytR8OxrXbREgGevkgESPGifFfeiBno0Gbrl8x7H2UWYg mIbxkusBUkfusdkgUy9fc2+wvpcJBht8zRFQMg4tU78PQHyqkr2q0s1wb0PYqHtINqxd U8H0+NfdQXPbSeGNdfaDVVWYei8OGYp6bewywIrimjsN+lV36icgzVmdzd+OUyZ43TIK 0v8eQGJnWDPy7ZvRs+8ZkCkUuxyO4FUHfcoK80OQfXHH05nx53/mVKSIsgQloclTadIJ ciQQ== X-Gm-Message-State: AOAM532YNThnAEY0p5aL8UIQGdL1+K/loyuen/Q21Zrgov8AfIzn7dQB 049wL9UcR3bi2nQxerRv9KRa8AwCdITtUG0Gb0oxAjVP X-Google-Smtp-Source: ABdhPJw5slDQf5tZs0Fo/ZvagbkBkB7ZyjKMwD61nMsyY1X62L99GQ66md6w2UeUTDDlqnRhtiUPH38zvMzmeD6FsYA= X-Received: by 2002:a17:90a:be10:: with SMTP id a16mr11529442pjs.133.1635912603874; Tue, 02 Nov 2021 21:10:03 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 2 Nov 2021 21:10:03 -0700 Received-SPF: pass client-ip=209.85.216.44; envelope-from=stefankangas@gmail.com; helo=mail-pj1-f44.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:218849 Archived-At: Severity: wishlist I'd like a way to mark a variable as safe only when read from a particular directory or file. I create a .dir-locals.el file with some unsafe variable, e.g. tmp=3D`mktemp -d` echo "((nil . ((epa-file-cache-passphrase-for-symmetric-encryption . t))))"= \ > $tmp/.dir-locals.el echo $tmp Now I visit a file in the created directory and get this message: The local variables list in /tmp/tmp.qakuGgnFPH/ contains values that may not be safe (*). Do you want to apply it? You can type y -- to apply the local variables list. n -- to ignore the local variables list. ! -- to apply the local variables list, and permanently mark these values (*) as safe (in the future, they will be set automaticall= y.) i -- to ignore the local variables list, and permanently mark these values (*) as ignored * epa-file-cache-passphrase-for-symmetric-encryption : t According to (info "(emacs) Safe File Variables"), hitting "i" means that: You can also tell Emacs to permanently ignore all the variable/value pairs in the file, by typing =E2=80=98i=E2=80=99 at the confirmation pr= ompt =E2=80=93 these pairs will thereafter be ignored in this file and in all other files. I would like to be able to mark this variable/value pair as safe *only* when read from this file, and not in any file.