From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8BGrFtXal2HPFwEAgWs5BA (envelope-from ) for ; Fri, 19 Nov 2021 18:11:49 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6FRCEtXal2ESfwAAbx9fmQ (envelope-from ) for ; Fri, 19 Nov 2021 17:11:49 +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 F0A4025278 for ; Fri, 19 Nov 2021 18:11:48 +0100 (CET) Received: from localhost ([::1]:54254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mo7QR-0003ho-4Y for larch@yhetil.org; Fri, 19 Nov 2021 12:11:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mo7Gh-00083Q-UF for emacs-orgmode@gnu.org; Fri, 19 Nov 2021 12:01:43 -0500 Received: from [2607:f8b0:4864:20::530] (port=34414 helo=mail-pg1-x530.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mo7GR-0003YS-US for emacs-orgmode@gnu.org; Fri, 19 Nov 2021 12:01:43 -0500 Received: by mail-pg1-x530.google.com with SMTP id 200so9173628pga.1 for ; Fri, 19 Nov 2021 09:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=zy+zr1OWy/j870e6rCZVaRbIexQKN3f1FsWDMVJdc08=; b=Fsrf8VIb2ePwBKne2axL1iPWSEE2IvoPjglr7zKy7meApnAWA2vUcDQGRe232lLzFH DyT6XrSPyk5YkjFObEGvbPNkRyyOADH59Q66MWaBXy//myb2o3G7WE87kjHJD6MoTgm4 XgZNITg9N5etwKn528tGrMgfu20jRex8CMnIHGhruWMF8ey8TLIm8g+BbISZ967Xf4uB msB/YJvoUDO63aN4+wcPg3DVkWrG/bC8mMvCVdsSEXyzravqgfRMMCLDpoDf6rq5vCSR ZQaPfG+RVh7hneOC1wfAdRUNpzVMbllzEflR8hD0uw5KvuBpmFFU04f7d8xclVLDphfy rTOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=zy+zr1OWy/j870e6rCZVaRbIexQKN3f1FsWDMVJdc08=; b=ols12VzgsECWkeLksdtvxhO5YKN3YQhUliznGvaGsKU8Sl58ODyVEHOLzA1z8Pk8ZJ MSJU+I+mtxK/jPTNYW5EcK1xC8HaYDpEmPg+7zZrL1N6Zhf70jT9e9TGD5sH6O/m31x2 mywend2INCLfDrRMoxqZZ80pA9bhP2U7H6fIX57m2sZHib/U9PioL6kYpOq7XFkPw+72 5ghSZL9WhpreUA6zr7JIVblE4V8D6GQd3/ktT34kyoxYLMzZXvz8oelDCB29KvhWZ90V CCyB5XLv4GSFxanMnPxmzKKJ0/szzqS2nHMqOVCiLDZT2BgrbrZkUFFudosQnl4B8CFk og6g== X-Gm-Message-State: AOAM530nyjwi4kz1cnihVSZcHPH8oPZIiZcbkJXuVlwATW/2lcMFIWmH ZzshC9lORl2tAMEqr3mqFHpxH+eQRJU= X-Google-Smtp-Source: ABdhPJwCcON++Feqzi5mbyxHs+fhKsE8pXQR1MhGwZpoaMRFSEDl8TXu3g4TBDm1tSuD7SQQmMavUw== X-Received: by 2002:a05:6a00:2405:b0:44c:1ec3:8dbe with SMTP id z5-20020a056a00240500b0044c1ec38dbemr24121644pfh.33.1637341285967; Fri, 19 Nov 2021 09:01:25 -0800 (PST) Received: from dingbat (2001-44b8-31f2-bb00-0bbf-8064-5177-ffac.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:bbf:8064:5177:ffac]) by smtp.gmail.com with ESMTPSA id n16sm196669pja.46.2021.11.19.09.01.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 09:01:25 -0800 (PST) References: <875yuh9b3t.fsf@gmail.com> <87czojh6m4.fsf@gmail.com> <8735ntg3ve.fsf@gmail.com> <87mtm1e5lt.fsf@gmail.com> User-agent: mu4e 1.7.5; emacs 28.0.60 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: [PATCH] Accept more :tangle-mode specification forms Date: Sat, 20 Nov 2021 03:31:16 +1100 In-reply-to: <87mtm1e5lt.fsf@gmail.com> Message-ID: <87pmqwt6zi.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::530 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=theophilusx@gmail.com; helo=mail-pg1-x530.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637341909; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=zy+zr1OWy/j870e6rCZVaRbIexQKN3f1FsWDMVJdc08=; b=dl5mU912tNfvNRrO6WvSCSqx0K0bU8hTVMYPgEDViH2HkSFXe6nTOjypDu93Xylrj+Z0y1 zAwfgPkey1VH5aNRumDkTutu1H0HnEd2RUj7PckTpkkRm9oYQ7h3zyS2lncR5UCfAtV4gq WbJfV0zVY85OtxfZtD+4FFnsvZvvkqgNgS09V6D/9jkFaJBXZyAI4jXFO2x4NSmvnbqyNs +12z40FuDwdjky0mbKIha5ocu6AXrrTgTYYMrdrMswOvvkZVPBQ32t1yZyUTXwQjNcOJTf +1+sCLdljwhTDcWqDhAumPFIK/05MjVd+Nd8B2BZ/X8nI/yLAZ4GeVEWJ2ewhQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637341909; a=rsa-sha256; cv=none; b=oXEIc4SrhoAvzqgUi1OM/STOPZzpv3yafzhOB1BasauKzejY+VIF6/054s16PM3tNJ+JE2 qpMmtEcl7U7u2u26LB1Lk7M7C7wKRwzQEs6He3VVU5QuNmLTNjB+3qymGeWFjEfFcCe66m 1K8haYDQ/gI1PH7zb6z1+DxOOraTih4qSXyUmRg4mBPhzH8R5mej43Zf5kDdd3f350dkqV 6jz7gMonDymuSN19Pnoctwt9OHI851FJEHRO7GqzbNBEAPBsIddFuBH4nkJqLlzqdHEpxP hg3Ak1C19fv29XJyrjCnIqD8GbRK3j6uJSlz+0fPv5Yb05n6Bh7HVBHHjRtWjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Fsrf8VIb; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.57 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Fsrf8VIb; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: F0A4025278 X-Spam-Score: -3.57 X-Migadu-Scanner: scn0.migadu.com X-TUID: 8bwUDWdlGAa1 Timothy writes: > Hi All, > > I thought I=E2=80=99d checked for this, but I=E2=80=99ve just noticed tha= t :tangle-mode 755 > doesn=E2=80=99t actually work as expected. I assumed 755 would be passed = as a string but > org-babel-parse-header-arguments actually turns it into an integer, just = like > (identity #o755). Obviously 755 !=3D #o755 and so this causes issues. > > As it stands =E2=80=9C755=E2=80=9D works, but that isn=E2=80=99t great (m= ost importantly, it=E2=80=99s easy to > confuse). Since it=E2=80=99s easier to add than remove things like this, = we could just > get rid of this for now, but a convenient octal notation was a large chun= k of > the motivation here IIRC. > > We could also change the implementation to handle :tangle-mode o755, whic= h will > make org-babel-parse-header-arguments parse the argument as a string. > > I=E2=80=99m be keen to hear other people=E2=80=99s thoughts on this. > Thanks for your work on this. I am a little concerned we are making a rod for our back by trying to make this overly clever in order to provide as much convenience to the user as possible. As this setting does have significant security implications, I would favour a simple and easily testable option which is concise and unambiguous over convenience. I would drop the 'rwxrw-r--' format as it isn't typical, not allow base10 mode specifications and possibly even limit what can be set (i.e. no sticky bit etc, just read, write and execute). Security issues are more often than not, caused by complexity. Things become complex when we try to satisfy too many options. In this case, rather than being liberal in what we accept and precise in what we send/do, I think we need to be precise in what we accept and do. I would just accept two formats, both being strings with either "o400" (or perhaps "#o400") and "u+rwx" symbolic form and anything else generates an error (a hard error, not a warning i.e. stop processing, don't tangle).=20 =20 Making the octal version be "#o600" rather than just "o600" would possibly make interpretation easier as it would avoid "o600" and "o+r" - if it starts with "#o" interpret as octal, otherwise try to parse as symbolic names. this would mean there will be some edge cases where you cannot set the mode precisely to the value you want. However, these will be fringe cases and requiring the user to take additional/special steps in this case is IMO not too much to ask in exchange for reliability and correctness for the majority and avoiding dangerous corner cases.=20