From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0AhoAISBp2AYVAEAgWs5BA (envelope-from ) for ; Fri, 21 May 2021 11:46:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id wGi9N4OBp2AdcgAA1q6Kng (envelope-from ) for ; Fri, 21 May 2021 09:46:43 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 703A510A45 for ; Fri, 21 May 2021 11:46:41 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 6C0CF2904F; Fri, 21 May 2021 05:46:36 -0400 (EDT) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by mail.notmuchmail.org (Postfix) with ESMTPS id 85E4429038 for ; Fri, 21 May 2021 05:46:28 -0400 (EDT) Received: by mail-wm1-x32b.google.com with SMTP id f20-20020a05600c4e94b0290181f6edda88so114080wmq.2 for ; Fri, 21 May 2021 02:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Cx9WiBr4jtX2IE8eOBBvQyOpIGuPem/poS/AUMI7bGM=; b=VKYDYDp2Rj8mNbJ6cy8+unROs3ZntXNvhvMhycHi6WXMgK8Q4y0Wv3vSWeU+DkJnUv NYjwrXiTQjORrH8feP9B4X5cQM0p2TzlY/YpVYJRg+xzq+MR3d5DUfJNxHa+S4fUO/kc OVWpIMN5b6WJQotbVXtXOJ6mkZam7SDsdzUQNd9Wv4BWpFGYFbqsFVlmK0k64fbP81f6 qN3ya0VlREiN57iw7cZMjV+gZUHbxXNwfQ0ZB0RuFzYe3L6SrDW+PHHO0KI5cCGiYhLk p0TEWLx3rYYkZ3NhDq3sk8rG6VCKQPFJSASjVI4SJjXyKY9ANgjWwlL1wsBf/WmGkOiw mPVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Cx9WiBr4jtX2IE8eOBBvQyOpIGuPem/poS/AUMI7bGM=; b=nLsRn3D2VqobhOrEgq6uWb651jHNP5goTBNYENrzjZynmd7OyNE8hy5474AzJZRfqI wCb30c9QfAnXughIWldKoOWltHKows2tVqOY77zldKouP1hDCLswdojxVF9ckTEoPf8V ua1yfkfdNB/YNcNZGlNhbGYbrM/w7rHjXOc5lHV/rKuKRzB10q/B4vKZCxFlTj/SFja6 bvzeHItBDxksO5f3vfYs77/VJDCdG/E9S2ytX8kpwqyazAKcgqoQ0KVMXVGxhFRiGnhm rEKhN4K9fMHL/CPFG/U1H3+r1BHbTxs2k+Cpocb45xvB1C64KA2Gmptui4++DCy8hlrL arXg== X-Gm-Message-State: AOAM531Ly4MroDF+4W97mpSCF+1YCZPCPVILv+aPldFDgZp18uKIevsM z8eDW44mz09o7RxJCNdOkwDeI5dvNQqRVpitLVo= X-Google-Smtp-Source: ABdhPJwxjGkYqtIi81nWQpIT+J/nov5KOBw63H2lgcUAWpeh0e5A5AbIsHlQqCVRzmPCviUUBnKEsj2N2K6l55LGYSw= X-Received: by 2002:a05:600c:3586:: with SMTP id p6mr6389274wmq.48.1621590386094; Fri, 21 May 2021 02:46:26 -0700 (PDT) MIME-Version: 1.0 References: <20210518055443.21964-1-tomi.ollila@iki.fi> In-Reply-To: From: Felipe Contreras Date: Fri, 21 May 2021 04:46:14 -0500 Message-ID: Subject: Re: [PATCH v3] test: replace notmuch_passwd_sanitize() with _libconfig_sanitize() To: Tomi Ollila Message-ID-Hash: F4STLMKERKGXWXD2KZRFCEFS6RJNPVK2 X-Message-ID-Hash: F4STLMKERKGXWXD2KZRFCEFS6RJNPVK2 X-MailFrom: felipe.contreras@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: "notmuch@notmuchmail.org" X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621590402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=zOqFeXq+iSQNCXg4UwwchQTdRAkiFMsdiEuVhs508o4=; b=Yh5NAWtaDOSPW+yRPZfVrTlOKKgPlFwNDI3Xa5JBKXwLTltL6sdLvYXz/xalDYKgvrUZnF Ma9bGvrF0IuzFlgXPURI3KlbHNyxMRJI+6ivW8ebZ5Vy5TLibbLqBq7d4pUV975Ckct/O5 11PY5TQUNq/aflJEtNtYBq+TXgQO08D44cnCsaD8w4nnAXWkTM94An/d3JtG1PP2U7CQeW vpg4ri1N2LEvyoufMUbYgOdBHimOPvkkUFLT7CUVZNB4rf42jlTnCNaaSbzm9o6LXboIxL zyf/Y0l6rmrlziumvBLeG2BTXyzJLFTn+VFA5MYLkaIWNHlwFUJFaxvqcrf6pQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621590402; a=rsa-sha256; cv=none; b=VHG2akhKsZfTFR8IXDoU7L8TL2fTMM7T5mh6Ofb1MBChaA+qT4u05gIZa1m+/0OSIYWI6Y 1YZ6oOTtEgMKi8nrIg6vz7afhHRhkwJHfi9jYG8vLve2eoAvzQhuF6P03T6KqK/SCFel3x NYhdVGu9xLv79bAbOcUwcvvsXeRcRBCiW21UyPrAejvGl9mOruYzpxIFff5AtxFOeOWyfo ur5CoJdq2EbYeyVSxdBfd4rLwSPWU3bhMjKhysIAN/kVjgZoMrv2gmxzBYPC2bLt+ZxxBi F7nbJ7+rwCcVyH2S1U1Am+u+QZR7nICrPLOO/G44TfQrwuT4ML3wlh234pz97A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=VKYDYDp2; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.97 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=VKYDYDp2; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 703A510A45 X-Spam-Score: -0.97 X-Migadu-Scanner: scn1.migadu.com X-TUID: Izh4aQJ+A2/s On Thu, May 20, 2021 at 2:43 AM Tomi Ollila wrote: > > On Wed, May 19 2021, Felipe Contreras wrote: > > > On Wed, May 19, 2021 at 12:34 PM Tomi Ollila wrote: > > > >> Haha, as we do _libconfig_sanitize < OUTPUT > OUTPUT.clean > >> reading python script from stdin don't work (perl has __DATA__ ;). > >> (bitten again, I did and tested the change... :D). > > > > That can be fixed with: > > > > python /dev/fd/3 3< > EOF > > According to > > https://unix.stackexchange.com/questions/123602/portability-of-file-descriptor-links > > that solution could be portable enough. What the operating system does doesn't really matter, bash emulates /dev/fd/x: "If the operating system on which Bash is running provides these special files, bash will use them; otherwise it will emulate them internally with the behavior described below." https://www.gnu.org/software/bash/manual/html_node/Redirections.html And as far as I know the testing framework only works correctly on bash... So... > Another way still using -c ... I've played to look how it actually looks is > (diff since patch v3) > > - sq = chr(39) # single quote > - l = l.replace(sq + name, sq + "USER_FULL_NAME", 1) > + l = l.replace("'\''" + name, "'\''USER_FULL_NAME", 1) Yes, that works too. But that's what I said in another mail that is weird stuff. I had to read it again three times and then copy to a proper text editor with monospace font to see if it was correct. > Tested the above. That python /dev/fd/3 3< have to be tested to see how it looks like and behaves... :D Yeap. Took me a while to find the right documentation to figure that out, but in my opinion it's better to write a helper for the tests once, and then forget about it and just re-use it for all. -- Felipe Contreras