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 ms11 with LMTPS id yCSXAzTqg18rLwAA0tVLHw (envelope-from ) for ; Mon, 12 Oct 2020 05:31:32 +0000 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 0Cz6OjPqg1+ZKgAAB5/wlQ (envelope-from ) for ; Mon, 12 Oct 2020 05:31:31 +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 889639401BC for ; Mon, 12 Oct 2020 05:31:31 +0000 (UTC) Received: from localhost ([::1]:35914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRqCj-0001kM-HZ for larch@yhetil.org; Mon, 12 Oct 2020 01:17:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRexI-0000vg-JN for emacs-orgmode@gnu.org; Sun, 11 Oct 2020 13:16:20 -0400 Received: from dustycloud.org ([50.116.34.160]:45918) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRexG-0000L1-PS for emacs-orgmode@gnu.org; Sun, 11 Oct 2020 13:16:20 -0400 Received: from twig (localhost [127.0.0.1]) by dustycloud.org (Postfix) with ESMTPS id 1DE4126616 for ; Sun, 11 Oct 2020 13:15:37 -0400 (EDT) User-agent: mu4e 1.4.12; emacs 26.3 From: Christopher Lemmer Webber To: emacs-orgmode@gnu.org Subject: Bug: ODT exporter permission issue on functional distros (eg, Guix) [9.1.9 (release_9.1.9-65-g5e4542 @ /home/cwebber/.guix-profile/share/emacs/26.3/lisp/org/)] Date: Sun, 11 Oct 2020 13:15:14 -0400 Message-ID: <87zh4s7kgt.fsf@dustycloud.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=50.116.34.160; envelope-from=cwebber@dustycloud.org; helo=dustycloud.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/11 13:16:01 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 12 Oct 2020 01:16:40 -0400 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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-Spam-Score: -1.01 X-TUID: oaT94UR1rMTd --=-=-= Content-Type: text/plain Emacs : GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20) Package: Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /home/cwebber/.guix-profile/share/emacs/26.3/lisp/org/) Not sure if this will work on Windows because it uses posix'y permissions.... but anyway I found that the ODT exporter did not work on Guix because the styles.xml got copied over as read-only. This fixes it for me. I've already done copyright assignment for the "AM/PM support on the agenda timegrid" patch I sent in 2010; I assume this has not expired over the last decade. If you check the use-by date and my copyright assignment has somehow gone moldy let me know and I'll be happy to update it. - Chris --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ox-odt-Fix-read-only-error-with-styles.xml.patch >From df53e6282e7113b2601490266315f5018d7f2d6b Mon Sep 17 00:00:00 2001 From: Christopher Lemmer Webber Date: Sun, 11 Oct 2020 12:56:34 -0400 Subject: [PATCH] ox-odt: Fix read-only error with styles.xml. On systems where the source file is read-only, it's possible that the destination styles.xml could end up read-only as well, resulting in an error when modified or deleted by us. * lisp/ox-odt.el (org-odt-template): Explicitly set permissions of styles.xml to read-write for the current user. --- lisp/ox-odt.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index 104319a9d..c2693d883 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -1375,7 +1375,13 @@ original parsed data. INFO is a plist holding export options." ((string= styles-file-type "xml") (copy-file styles-file (concat org-odt-zip-dir "styles.xml") t)) ((member styles-file-type '("odt" "ott")) - (org-odt--zip-extract styles-file "styles.xml" org-odt-zip-dir))))) + (org-odt--zip-extract styles-file "styles.xml" org-odt-zip-dir))) + ;; It's possible that when copying the file from a location that's + ;; read-only that we accidentally end up with a read-only styles.xml + ;; here also (eg on Guix systems)... this prevents that from + ;; blowing up + (set-file-modes (concat org-odt-zip-dir "styles.xml") + #o600))) (t (error "Invalid specification of styles.xml file: %S" (plist-get info :odt-styles-file)))) -- 2.28.0 --=-=-=--