GNU bug report logs - #51579
Mark variable as safe only in one file or directory

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Stefan Kangas <stefan@HIDDEN>; dated Wed, 3 Nov 2021 04:11:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 51579 <at> debbugs.gnu.org:


Received: (at 51579) by debbugs.gnu.org; 4 Nov 2021 18:10:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 04 14:10:27 2021
Received: from localhost ([127.0.0.1]:43410 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mihBz-0006kC-2Q
	for submit <at> debbugs.gnu.org; Thu, 04 Nov 2021 14:10:27 -0400
Received: from quimby.gnus.org ([95.216.78.240]:58018)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mihBx-0006jz-3V
 for 51579 <at> debbugs.gnu.org; Thu, 04 Nov 2021 14:10:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=NPEirhUy8HDhZrjWR9RfDWS4Mwbh4rtjOpc7jQwMEW0=; b=H0jVGZfLiDaOZkCHTauMoi8xux
 AkdwOSf6AoGJ3plI94f+WxR0VGi4V6vK8cCQz+CXmYDeL8eNhZXEm3Um8Fp04SSrf1Xeo6YeAiUaN
 Yh+ZIRKnUyqu/gpoQw+m+U231ECo8wptu+sUxx4xSFGZyK5cn/Hn4J0XWuyVoys0RXrA=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mihBp-0005LS-3r; Thu, 04 Nov 2021 19:10:19 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Stefan Kangas <stefan@HIDDEN>
Subject: Re: bug#51579: Mark variable as safe only in one file or directory
References: <CADwFkmn85UpFdgnmQxQ+2TahMkHDv7yCzOWHi6jLAT7rB5hM=w@HIDDEN>
X-Now-Playing: Orange's _Orange_: "Swim"
Date: Thu, 04 Nov 2021 19:10:16 +0100
In-Reply-To: <CADwFkmn85UpFdgnmQxQ+2TahMkHDv7yCzOWHi6jLAT7rB5hM=w@HIDDEN>
 (Stefan Kangas's message of "Tue, 2 Nov 2021 21:10:03 -0700")
Message-ID: <87fssbssfr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Stefan Kangas <stefan@HIDDEN> writes: > 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. Yes, that sounds like a good idea to me. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51579
Cc: 51579 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Kangas <stefan@HIDDEN> writes:

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

Yes, that sounds like a good idea to me.

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51579; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Nov 2021 04:10:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 03 00:10:12 2021
Received: from localhost ([127.0.0.1]:38605 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mi7bI-0005jV-7V
	for submit <at> debbugs.gnu.org; Wed, 03 Nov 2021 00:10:12 -0400
Received: from lists.gnu.org ([209.51.188.17]:58988)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1mi7bF-0005jH-5j
 for submit <at> debbugs.gnu.org; Wed, 03 Nov 2021 00:10:11 -0400
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 <stefankangas@HIDDEN>)
 id 1mi7bD-00023D-SI
 for bug-gnu-emacs@HIDDEN; Wed, 03 Nov 2021 00:10:09 -0400
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 <stefankangas@HIDDEN>)
 id 1mi7bB-0003Gg-HG
 for bug-gnu-emacs@HIDDEN; Wed, 03 Nov 2021 00:10:07 -0400
Received: by mail-pj1-f44.google.com with SMTP id om14so399343pjb.5
 for <bug-gnu-emacs@HIDDEN>; 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)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Tue, 2 Nov 2021 21:10:03 -0700
From: Stefan Kangas <stefan@HIDDEN>
MIME-Version: 1.0
Date: Tue, 2 Nov 2021 21:10:03 -0700
Message-ID: <CADwFkmn85UpFdgnmQxQ+2TahMkHDv7yCzOWHi6jLAT7rB5hM=w@HIDDEN>
Subject: Mark variable as safe only in one file or directory
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=209.85.216.44;
 envelope-from=stefankangas@HIDDEN; 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-Spam-Score: -0.8 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.8 (-)

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.




Acknowledgement sent to Stefan Kangas <stefan@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#51579; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 4 Nov 2021 18:15:01 UTC

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