From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ignacio Casso Newsgroups: gmane.emacs.bugs Subject: bug#53876: 27.2; "eval: (X-mode)" is always safe as file local variable Date: Tue, 08 Feb 2022 10:29:16 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30215"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.10; emacs 27.2 To: 53876@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 08 15:51:56 2022 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 1nHRqW-0007dz-4E for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Feb 2022 15:51:56 +0100 Original-Received: from localhost ([::1]:36892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHRqU-0003n0-LC for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Feb 2022 09:51:54 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHQdA-0005SY-Ln for bug-gnu-emacs@gnu.org; Tue, 08 Feb 2022 08:34:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHQd9-0004aQ-0P for bug-gnu-emacs@gnu.org; Tue, 08 Feb 2022 08:34:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHQd8-0003TC-PK for bug-gnu-emacs@gnu.org; Tue, 08 Feb 2022 08:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ignacio Casso Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Feb 2022 13:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53876 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.164432722413296 (code B ref -1); Tue, 08 Feb 2022 13:34:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Feb 2022 13:33:44 +0000 Original-Received: from localhost ([127.0.0.1]:45861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHQcp-0003SI-LQ for submit@debbugs.gnu.org; Tue, 08 Feb 2022 08:33:44 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:53210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHNvs-0002bh-Hz for submit@debbugs.gnu.org; Tue, 08 Feb 2022 05:41:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNvs-0008Cc-0G for bug-gnu-emacs@gnu.org; Tue, 08 Feb 2022 05:41:12 -0500 Original-Received: from mail-am6eur05olkn2016.outbound.protection.outlook.com ([40.92.91.16]:54369 helo=EUR05-AM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHNva-00005y-HH for bug-gnu-emacs@gnu.org; Tue, 08 Feb 2022 05:40:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e4M1XRvAXi4nva9dW6k37eOrSGT0dV/qltqEtEOWPIlsc4pZJ7c6AAEqRYbtZuqZ4qaHrshoCOSePGD1MqmxKGxtBHgzugKS0IMYp4T7nHRvqkhXldoSXKhtSBuMjhnYmWN7L9+EHuoxwSRv47mchFuGZGSbkZn4OE17tLVcxzRhOmB8WfAcA8/xk52dMmaig3qPxYZJzsX4FcWXykQweCkVZvOE05KmdxsDPDFgd6I9mJO+CRPKefN0yIcHP7tTdj1SnATc1sDcPcwNzCb2qxc5vQ3fl2mDTobGURbtAdXwOrn89MIa9G1vtR3hoeO/A/2LnHDAJuhq8RusU0ythw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=62kL/FQNJIA4FvF67WLLFYhWcM0u15CqMW4neDt8v5g=; b=hioXvKHO0LLLPBhCju+adjXt0ZbHpXAO7FhwAMikiiXwwP+EcnHHJqxV/IAb0jUrmBpcCinm1CkFTDkhwA+PxnrusPSLHZ1JCYFrQD41WemrVdyuBT9DzsG0zimwcvjRn9DPSd1ebUNHhHqGbs6Vvmd7tH6zN4IvyjRRBUAIgRXZdqyn0w2/KwgDbsCXhEU0y+VT3nQ8shU5XYyDWXHobVwSO+OfwLFzMjf3FlE5LniYu2b91wEOqqp0Tom+CSfX9suBCMLNlFF8ltD3se64wM1sSd7cywRlVYRmi0qv35JU3exVEKCefprDsR+jOKCXx9WCIz9En6k1yboIriVqfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=62kL/FQNJIA4FvF67WLLFYhWcM0u15CqMW4neDt8v5g=; b=eke9A+NSEW04lslbLT3VGV3T55q6JLq74WfUYvo1lRL3TWQJwlBRv7Lmj03YMqsa1ypbMmcIhiFpJSbX2OCUwya4dmHa9sDL++kX8vExh+21CkMEJK6gOrdzvOwtbRvQXutZEUvMje30vAnUAaCBy6oQf53fy6GlV7TTRlVVvafrNjUMKOrEgnX9Ho2O6xTTS6KXBghz8Oefi2JlkeFfwO95bqcq90IkXJQfTqqmXx2SEZgcumbYK/gJMEWGmM/NuRHfX+zdDjV4ZtFZg9tucu9/9So9DT6SB6rBZ0u5KfJM8MHaTzdV6FBiePEh8gmoc7JsqcvNfjkkLfggykT5Ng== Original-Received: from PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) by AM9PR06MB7954.eurprd06.prod.outlook.com (2603:10a6:20b:38b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.11; Tue, 8 Feb 2022 10:20:06 +0000 Original-Received: from PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::50de:9162:7856:2782]) by PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::50de:9162:7856:2782%5]) with mapi id 15.20.4951.019; Tue, 8 Feb 2022 10:20:06 +0000 X-TMN: [y71dT+UI4cmYffYYp90R+CsQfHH+PgK0] X-ClientProxiedBy: MR2P264CA0003.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:1::15) To PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) X-Microsoft-Original-Message-ID: <87leyl3bjj.fsf@hotmail.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5b08279-c00e-41ea-ef7f-08d9eaec9391 X-MS-TrafficTypeDiagnostic: AM9PR06MB7954:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ntSu3e/YlYPD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b+NdBLKl962nuJCoVeIGM7CuwtCNEq5SYIhW4rFXNySpqOzOK4E/ZlKu6Oi/H22xUxZVOyAC0eBUQAF5xX4h6Ec99MSnCrJriVyY1ivM7bKxbhhi1GVpYzuGfOYMXQQYLAou456k0f8wVD15iUBj5IEqYYBrfJR+RYYrkoIVkBT+sTEOptoHubZcLJdPwGracP1GiJamB0lrsbAsY42M72hOMiMDYvKAxrJUkYCuTKbl67BvXtZ02VW5cub5N57VLUrBqs7xJmSYYaPm9ue7hf08vp9vQSPsFwXAkFjSrjF2WU1wlMaDYbvK/T3ol Arzt7pAS6KBBrMM0FmTw+GQTwRxq5PYz1IBJyidTSX07i0Sja96mgL5GvuU8lzOw8Zbmgw5Y84m/vp2+Dnkk45BFdBXvktAM2z X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6e454.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: d5b08279-c00e-41ea-ef7f-08d9eaec9391 X-MS-Exchange-CrossTenant-AuthSource: PAXPR06MB7760.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 10:20:06.2537 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR06MB7954 Received-SPF: pass client-ip=40.92.91.16; envelope-from=ignaciocasso@hotmail.com; helo=EUR05-AM6-obe.outbound.protection.outlook.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 08 Feb 2022 08:33:40 -0500 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:226373 Archived-At: Hello, I've noticed something that I believe it might be a bug. With Emacs 27.2 and the default configuration (starting with emacs -Q), I get the following behavior: If I visit a file ending with the three lines below, I get the usual prompt asking whether I want to apply the local variables since they might not be safe. So far so good. # Local Variables: # eval: (message "file was visited") # End: If I visit a file with the following local variables instead, I don't get that prompt and the form is evaluated immediately, so I get line numbers in the buffer. This happens for any other mode. # Local Variables: # eval: (display-line-numbers-mode) # End: I'm not sure if that is still good, but the real problem comes now, when I define a function with a name ending in "-mode", like the following: (defun not-really-a-mode () (message "This could be doing something nasty")) If I visit a file with the following local variables, I don't get the prompt either and the form is evaluated immediately. # Local Variables: # eval: (not-really-a-mode) # End: (Of course, activating an actual mode could be doing something equally nasty, but somehow I find this worse) I've investigated a little and found the function hack-one-local-variable-eval-safep in files.el, which is responsible for this. It has a comment that says "Allow (minor)-modes calls with no arguments.", and just checks whether the function ends in "-mode". I'm not sure if it's a bug or a feature, and it's not important at all to me, since it's actually convenient. I'm just reporting it since I noticed it and I'm trying to get in the habit of reporting (possible) bugs when I find them. Best regards, Ignacio In GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20) of 2022-01-16 built on ignacio-IdeaPad-3-15ADA05 Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: Ubuntu 20.04.3 LTS