From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74879: 30.0.92; trusted-content-p and trusted-files cannot be used for non-file buffers Date: Sun, 15 Dec 2024 13:18:27 +0200 Message-ID: <868qshry7w.fsf@gnu.org> References: <87ed29ixu8.fsf@daniel-mendler.de> <875xnlfdzi.fsf@daniel-mendler.de> <86cyhtrzmo.fsf@gnu.org> <87jzc1dxk2.fsf@daniel-mendler.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7629"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74879@debbugs.gnu.org, monnier@iro.umontreal.ca, stefankangas@gmail.com To: Daniel Mendler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 15 12:19:17 2024 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 1tMmea-0001o9-0d for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Dec 2024 12:19:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMmeO-0007FB-IJ; Sun, 15 Dec 2024 06:19:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMmeM-0007El-Nh for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 06:19:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMmeM-0000NB-Eu for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 06:19:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=BLn+RGhzH3IIiAnCk5NA8GnuVzEWTSOJDjWFcGIkRl0=; b=TykOhd+5uaPvjycmY1ncCnwy7KH4SW9xxyDnwUN1UlY1owVUPrp5TGdB6dLQP3QUpuqEqMXjtHcErXmdU8T5k8T9kYwPvcfJrfT0utMyo4B8XccC0/clVeC1fc3l04W54iN70H/u/rksB3uA3gdsVgYDwCxcAvVFQ0Rrl4RiHyJv65xQNaqwwVOZabY12EMnt2IywnfEjTlIyMH0eYsaZPdX9ulcFRaookJApspgf6ooMmXEQ9ZzXBFrIjRTWfmkAXefBg86V8WHJidYWuPTAkMndVnon0NNVVRqboWvT8Q+MPA8O1JuUox5iaknqYdReiySj7BITsAXKr+7H0hljQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMmeL-0007uN-Jp for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 06:19:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2024 11:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74879 X-GNU-PR-Package: emacs Original-Received: via spool by 74879-submit@debbugs.gnu.org id=B74879.173426152730376 (code B ref 74879); Sun, 15 Dec 2024 11:19:01 +0000 Original-Received: (at 74879) by debbugs.gnu.org; 15 Dec 2024 11:18:47 +0000 Original-Received: from localhost ([127.0.0.1]:49706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMme2-0007tn-Ic for submit@debbugs.gnu.org; Sun, 15 Dec 2024 06:18:47 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMmdy-0007tW-PR for 74879@debbugs.gnu.org; Sun, 15 Dec 2024 06:18:40 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMmds-0000Lc-M0; Sun, 15 Dec 2024 06:18:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=BLn+RGhzH3IIiAnCk5NA8GnuVzEWTSOJDjWFcGIkRl0=; b=dj7eQMj4mQQv qD0wGz/4c8NmbXU7WhIcQVZ46gKaNMWjDNzBcQuNQ7eP/1O4jX4jtAaDKuS/9Z/XC2DM+f6DGKON8 kx6zaPLUMTMv10tdIqzTn6LiPRQ0lyl0LIweeA2SdF4DvrYAcJH2vwp5rz5BauxxOvlgraX87Nyso IZO0aHIgnpHDP0bEkqrJK4KnqGXJh/E8d6mKqUT3LbkSlLhgGX8Iavh76t+YU8GNisy3Zpx20psBw yZ7McVomLGSfas3J0c2pSnkmcLrKfmX7fpSR5fgGbYkcv3qF8HKmieF7+u3i5Q1vqGAlHkKbv3VlU OvikEM3uHuQeTh00WFW6vw==; In-Reply-To: <87jzc1dxk2.fsf@daniel-mendler.de> (message from Daniel Mendler on Sun, 15 Dec 2024 11:56:29 +0100) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297095 Archived-At: > From: Daniel Mendler > Cc: 74879@debbugs.gnu.org, monnier@iro.umontreal.ca, stefankangas@gmail.com > Date: Sun, 15 Dec 2024 11:56:29 +0100 > > Eli Zaretskii writes: > > > What do you envision trusted-buffer-function should do in a buffer > > that doesn't visit a file? > > `trusted-buffer-function' should be a hook variable, which could be set > to multiple functions, e.g., #'trusted--files-p and > #'trusted--buffers-p. The function `trusted--files-p' would check the > variable `trusted-files' similar to the existing code in the emacs-30 > branch. I was asking specifically about the non file-visiting buffers. > The function `trusted--buffers-p' could check another variable > `trusted-buffers' which specifies a list of buffer name regexps or > probably even better a `buffer-match-p' condition. This way the user > could specify buffers which they consider safe, for example *scratch*. Why would a buffer's name tell _anything_ about whether the user can trust it? > In the end it is up to the user how the variables are configured, as is > already the case with `trusted-files'. The user must define which > directories/files/buffers they consider safe. If we wanted to let this completely up to the user, we wouldn't be introducing this feature, certainly not so close to a release, would we? The question is serious: how do we envision this "trust" thing to work with buffers that don't visit files? If we are to change the code, certainly on the emacs-30 branch, we need a solid solution which provides more safety/security to users. Adding a variable doesn't solve a problem, it _adds_ a problem (how to populate the variable).