From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yEyyLnK6kWBmWgAAgWs5BA (envelope-from ) for ; Tue, 04 May 2021 23:19:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EC9QKnK6kWAoRgAAB5/wlQ (envelope-from ) for ; Tue, 04 May 2021 21:19:46 +0000 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 0B55A1B8DF for ; Tue, 4 May 2021 23:19:46 +0200 (CEST) Received: from localhost ([::1]:48774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1le2SH-0008F4-62 for larch@yhetil.org; Tue, 04 May 2021 17:19:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1le2Rp-0008Ej-5q for emacs-orgmode@gnu.org; Tue, 04 May 2021 17:19:17 -0400 Received: from mout01.posteo.de ([185.67.36.65]:49955) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1le2Ri-0006gp-WB for emacs-orgmode@gnu.org; Tue, 04 May 2021 17:19:16 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id C4DE7240027 for ; Tue, 4 May 2021 23:19:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1620163147; bh=lw9l5BuSbJmgCRPCcYq8hOehy82ZQTFHM+/Fa40vy98=; h=Subject:To:Cc:From:Date:From; b=hbtKlF9lucOX50+Ht2DSkVQ5U+QcvIUsD7pqXdQgEHJ17imOuuK/1zC0lCfgD7MbN CdebP4Wxsl+WWAyn2INjbyB+NIA9U+kVSnYyH7I3vuphn4bjDVqdnR2+rMmM3xmNvJ OdHrRRS5U4ZnZP3ap2he3z6HGoad8JXQhD+WK7tCzQrzD7Xb4ci4JFkODsuHLQiV9d uKaTBL6aHttuDH6fk9w4gHU4cJcC069b9r6ryrGqCFcqJP8F0WaZxdLMBCl5flNSHb TYE8dq9sdAyf8FYe0tod344zemiwis1+k5vN9kMDYruWymdM8fIFcQ44QDveNRi+jd J8tydKiHReB3w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FZXlb0N1qz6tmF; Tue, 4 May 2021 23:19:06 +0200 (CEST) Subject: Re: Bug: org-babel-tangle: persmission denied when tangling [9.4.5 (9.4.5-gbc2659 @ /home/n/.emacs.d/straight/build/org/)] To: Bastien References: <875yzy73k0.fsf@gmail.com> <1e5a447a-2453-09da-fa51-379c9187b210@posteo.eu> <8735v2706t.fsf@gmail.com> <87im3ys0ik.fsf@gnu.org> From: =?UTF-8?Q?S=c3=a9bastien_Miquel?= Message-ID: <28c262ba-7816-a38f-8d1d-c4d6d880d2e2@posteo.eu> Date: Tue, 4 May 2021 21:19:06 +0000 MIME-Version: 1.0 In-Reply-To: <87im3ys0ik.fsf@gnu.org> Content-Type: multipart/mixed; boundary="------------E9D2EDC7BE918F2D3849D03A" Content-Language: fr Received-SPF: pass client-ip=185.67.36.65; envelope-from=sebastien.miquel@posteo.eu; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sebastien.miquel@posteo.eu Cc: Tom Gillespie , emacs-orgmode@gnu.org, No Wayman Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620163186; h=from:from:sender:sender:reply-to: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=S6sF8iLhNX+mx37KCEF+Om8JOgs2w9mRP+cE/qV8KHE=; b=qJw0fXpTkgCmFJj4fM3fYLj7xEWoOe3tFpQQlEpwVC+sP7yFgEAoWcF1GTr0dzaAs3/6Zl uwcOa5Q16TpgcDSZn3chs2JpwWRz0cVukGh5NjzuWCB6q5nmOZlKiVN9yAl8IjWQfZZlS3 SlQ523TEhrGc8Y1TTDZCyldj6JQpMuv3ow3rm+FJM8401ttWYxhzXN+FnNJV4JnnU0c906 6vHMVHRrjsbDL03NzUF3U6VJun7YEhNHI6PAXOQqLwC1ZraCDiOLEYMcRii9NeciKnRqmA 6FkBo7dkyW90mzeHiuOLlfhunGNqT3emRYl9W0OXQKsnoykNtEQZxnkr7rwKkw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620163186; a=rsa-sha256; cv=none; b=axRAjLh1rFF1tB13hqBdRsK6S0Ar7GJV4J+U02CUU+YR3fIFpHKqqAxI3YpMCCgvVujA5y INgJ7chph8lEcgM5RfBouVN4SRnOVRBzZarni/AkfFu/56brEKoMQkq6HOl6h+7jUpgPFK NkYACeXuoM3ngiYA5ORLGkP33ymKx93HMa24MbavRaoxkwDbuyeWxmpGJlaHlSFqjLM6dl +MdAaOD/XUndoeHYcuCixoAQatMQBKDmPcZmwAUUCbRb2ZLcvh89KY82fDbYZMxvkQQIsE PVqZKqMJ3oxCeD/GB/W3mVJkw+sxa+QtLGPyHCFNJNzqmx5x6rDO+w3jscdnww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.eu header.s=2017 header.b=hbtKlF9l; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: 0.14 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.eu header.s=2017 header.b=hbtKlF9l; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 0B55A1B8DF X-Spam-Score: 0.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: sqas0+Yuu17i This is a multi-part message in MIME format. --------------E9D2EDC7BE918F2D3849D03A Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi Bastien, Bastien writes: > I tried to apply this (transitory?) patch against maint and it did not > apply. It applies okay on master. For bug fixes, please make patches > againt the maint branch. This fixes a bug introduced by a commit in master. I've attached the same patch here, properly formated. I think it should be applied to master. It reverts a part of a2cb9b853: permissions are no longer set before writing to the tangled file. I've CC'd Tom, which made the original suggestion. I guess we could set the write and execute permissions before writing, and set the read permissions afterwards. -- Sébastien Miquel --------------E9D2EDC7BE918F2D3849D03A Content-Type: text/x-patch; charset=UTF-8; name="0001-ob-tangle.el-org-babel-tangle-Fix-readonly-tangle.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-ob-tangle.el-org-babel-tangle-Fix-readonly-tangle.patch" >From e56a05f4f5a3cce9cfdeb71854475e29aac1a6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Tue, 4 May 2021 22:59:36 +0200 Subject: [PATCH] ob-tangle.el (org-babel-tangle): Fix readonly tangle * lisp/ob-tangle.el (org-babel-tangle): Fix readonly tangle. --- lisp/ob-tangle.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 36144d6ae..96a4ef049 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -268,11 +268,11 @@ matching a regular expression." lspecs) (when make-dir (make-directory fnd 'parents)) - ;; erase previous file and set permissions on empty - ;; file before writing - (write-region "" nil file-name nil 0) - (mapc (lambda (mode) (set-file-modes file-name mode)) modes) + ;; erase previous file + (when (file-exists-p file-name) + (delete-file file-name)) (write-region nil nil file-name) + (mapc (lambda (mode) (set-file-modes file-name mode)) modes) (push file-name path-collector)))))) (if (equal arg '(4)) (org-babel-tangle-single-block 1 t) -- 2.31.1 --------------E9D2EDC7BE918F2D3849D03A--