From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id ELizLiROV2FjgAAAgWs5BA (envelope-from ) for ; Fri, 01 Oct 2021 20:06:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 2HlMKiROV2ExXQAAbx9fmQ (envelope-from ) for ; Fri, 01 Oct 2021 18:06:28 +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 1534312A1D for ; Fri, 1 Oct 2021 20:06:28 +0200 (CEST) Received: from localhost ([::1]:41412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWMvT-0003U8-1J for larch@yhetil.org; Fri, 01 Oct 2021 14:06:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWMuL-0003SH-Gp for emacs-orgmode@gnu.org; Fri, 01 Oct 2021 14:05:20 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:36661) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWMuH-0005Za-Dr for emacs-orgmode@gnu.org; Fri, 01 Oct 2021 14:05:17 -0400 Received: by mail-wr1-x42d.google.com with SMTP id h15so15129738wrc.3 for ; Fri, 01 Oct 2021 11:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CqCR/AoCigEU2CmzuBuVUhFfAFDsd0sfeYuw4yS/ZCk=; b=XN8jTirRIcJ3k0gRH67pJ8FcQF+jqvseHILgAxS2UxNUjsBZUAXYuY8NmKZPbFEKmB PjQL8r9G7fEe5971YcI+FTnLvi4jbyxCdVcoEmbkggDe70i66VfWxg5mdjSdyR0rpA8Y Be93UqiVVAxrbtd3tIzbLx43gsQeMSoYHj7uuLjoRCogVhSkUzrhFk4WnTWyNnPYEdJL owcRsxdVu5IChpGHap7lN6vlwPlCK7ujpzJE5cGGXopkRQBqAsbdeFeIkd5OZCZNB/td HDRJsFJ/BGqHMcsRTWueEAOn2bNZfBo7aPVJCMSFL8MUtoWwVZAlQuX/8trtZ6DQpN5p Q4hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CqCR/AoCigEU2CmzuBuVUhFfAFDsd0sfeYuw4yS/ZCk=; b=XgL6EG5Y3kmJr2GzbDsdgKwX8puqtXypALZKPotOy3R9NtQ19PtcKZDpCgwuVag7C4 uh1hpRUwqYDh0dWD9U1X3hsIc/3tM/vadDnmf22Q42mPPN47Rs1eg+K7szco15E83vg2 8awR2uuuQzFI4ggSfTPksR+CavsyOIBlR0dqUpBib6sQUltDKvLJ43arMVOk9tuwD7OL VHmCO8UZOZ60p3D5ccS/1RBA3wpqaeDYNp6/JMLEKkt+htAi1OPuTFivACiS5VOey6fD coaSXjSUoAxLeCMb6tXcj0aszm+49675lx7aEaiEIKP3FyUAwJJLqp4qN7Ln7vzBeujV 2HZw== X-Gm-Message-State: AOAM533cczS1dE/JL9ul+IXk8vLBprrO3AWzPcMGzYBhwL7TjUz2fKQQ aC5UU2m2zOWNVa+/KaJnfrDNTM6ZtggTMIuNPO9NRD4pehM= X-Google-Smtp-Source: ABdhPJw2xLad8Em5IkPOwoiu8jWVT6BZeP1ZkaS8OLUXnqUgDpL89SpX621XK2f/J10K/Nm1+YfzwvwJhdDrVG33Bw0= X-Received: by 2002:adf:e6d0:: with SMTP id y16mr14177444wrm.181.1633111510915; Fri, 01 Oct 2021 11:05:10 -0700 (PDT) MIME-Version: 1.0 References: <875yuh9b3t.fsf@gmail.com> <87a6jtjj20.fsf@gmail.com> <87ilyh5aci.fsf@ucl.ac.uk> <20211001102957.GF16352@tuxteam.de> In-Reply-To: <20211001102957.GF16352@tuxteam.de> From: Tom Gillespie Date: Fri, 1 Oct 2021 11:04:59 -0700 Message-ID: Subject: Re: [PATCH] Accept more :tangle-mode specification forms To: emacs-orgmode Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=tgbugs@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) 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, 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: , Cc: tomas@tuxteam.de, mail@christianmoe.com, TEC 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=1633111588; h=from:from:sender:sender: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=CqCR/AoCigEU2CmzuBuVUhFfAFDsd0sfeYuw4yS/ZCk=; b=WLT2NNH+GgCeLg88c86fs+k68ZrIMp5I1IvuMWdKjeXGuDGpPO959T2Cilm/862FAo4GpZ 4KtcckWkxHTZyzRT8ZH4hJXfdx1m79IpaKyNTrhXYniWac6eJ5AbI4Hd7X+hlLt7vpb+yK TRU/egGHo2g0LdfDcPkqf87Q+U4blZqC3m4EvZytEbhwfc4Yml7UxX/MqvtsNkPv1rRCiN vzgI4X+Yw2TwBTJRsVOlWBKuMHacjgLv8O6tXCMVmXwvG4lwmNF0tRt6A++tBQALu5rKCd Qlo6FmD2NsgQJXK1YzVxcmw3yMF364gij+Sv+/Cpwa4ptfFNCKBvFnPgSFEJDg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633111588; a=rsa-sha256; cv=none; b=DvqNBFpj+T93mZmEo6cWE2jM88QulsRRYjfosGR5rrfhHZtsGJBFK5zl8WWf15xxLOM27r f85+TIEfbCqbIC/wccSEYkkMMOZ12hnXq+eep8+DTJ+dAacDK5qICvbhVKqNnUJS+o66RW YkMt+b0BLlUIe4SkqAWHnSWX7HDcfgi4ri8UJ81wEhofE4JbuovPKhweeRpsmmnKaumc0I Zi2+Bj/JJTEW97zCvIQ757wJAGwbQcrWfWTqMmWy3tjvJjxK5T6GY7Y1PRC2+NU9sByRkY xYs+Hi3bBQh3J0Du2svwQthPK6gQ4/JqZ44U/z3i2SzNh6RukhED7RS0iEdvxQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=XN8jTirR; 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: -1.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=XN8jTirR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (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: 1534312A1D X-Spam-Score: -1.70 X-Migadu-Scanner: scn1.migadu.com X-TUID: trcRorn9S6Zu > I'd like to understand these objections better. Aren't you overstating what is at issue? Yes, after hitting send I realized I overstated my position a bit. In the meantime the comments in this thread are encouraging, however I have finally figured out what I was really trying to say. tl;dr file permission modes are not universal and should thus not be part of the Org implementation, Org itself knows nothing about files or permissions, it is the system that Org is running in/on. Therefore, so long as we make it abundantly clear that the value for :tangle-mode is not expected to be portable and that it is always up to the user to ensure correct behavior, then we are ok. I'm not happy about this conclusion from a security perspective, but it isn't really worse than the situation we have right now. As many have pointed out, the grammar itself will not be affected. However, other parts of the spec will. In general my objective is to try to reduce the number of special cases that an org implementation has to know about and delegate them to something else. However in this case it is a bit tricky because of the security implications and due to the fact that octal modes for file permissions are NOT universal and should not be expected to be universal! I actually think that my gut reaction was correct, but was expressed in the wrong way. Unix file modes are not universal and should thus not be encoded as part of a portable document format. This means that it is up to the user to know what representation is suitable. Right now that representation is delegated to Emacs, because Emacs handles file permissions for Org, and Emac's language for modes is octal. There are some octal modes that do not translate on Windows, and cannot be correctly set. There will (hopefully) be some happy day in the future where there is an operating system that will run Org babel where octal file modes do not exist at all! Therefore I suggest that we do not enshrine a particularly obscure way of expressing file modes into Org itself. Right now Org is confined to Emacs' representations, which in a sense protects Org from becoming too ossified by bad designs of the past --- Emacs can keep all that for us! If we want a more user friendly syntax for this I would suggest that we do something like what has been done for Org babel :results, i.e. like :tangle-mode read write execute, unfortunately that does not compose well at all with user, group, and other and becomes exceedingly verbose. Final conclusion, after all that rambling, is that I'd actually be ok with any of the solutions proposed, so long as it is clear that :tangle-mode will always be implementation dependent, and may or may not be meaningful depending on which operating system you are using. Unfortunate for security, but I don't see any way around tha. The best we could do for security would be for implementations to test the file modes after tangling to ensure that they match, which is more important I think. That said, reducing the number of forms as Eric suggests would be a happy medium. Best! Tom