From patchwork Fri Feb 8 03:17:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Zullinger X-Patchwork-Id: 10802399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B79C113BF for ; Fri, 8 Feb 2019 03:18:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7F892E5AC for ; Fri, 8 Feb 2019 03:18:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BD4B2E5DE; Fri, 8 Feb 2019 03:18:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4033D2E5AC for ; Fri, 8 Feb 2019 03:18:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbfBHDSA (ORCPT ); Thu, 7 Feb 2019 22:18:00 -0500 Received: from pb-smtp2.pobox.com ([64.147.108.71]:57533 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726860AbfBHDRx (ORCPT ); Thu, 7 Feb 2019 22:17:53 -0500 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id EFB3F14484C; Thu, 7 Feb 2019 22:17:50 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=BlOgcw+nxmsYilFBcmvXRcNHY Po=; b=Rf4e7bB7fkl4Ffr3FmQvuVREC1PcUxkOmtE+7tOr+9tmpGDJuRO43AKAf icfMZF5UoeviT5Cc5/tg/6cvmk7uSxXWdtu+PktG5D0mnRTmdX868cjR3MT7EceL tbLsahe0gwDkdUqolZar9AoypsZOuI/I9azhB7bXYweXZTIBo4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; q=dns; s=sasl; b=FvT69kjVPX/eICa/ell /6SrVeT3GkSKVbEYiL2yF2N3V0BR3bGoQldwDGqrn30pCVcXrhI9/w4GWmxTP02U /jbezhozTG4MFbyMsxziATsUFSUcumQBOj0bN6y/FZrpVmc0BS9ZEO2h9r1b09qq dvywPlzSWQv6pSfbU70Axu7s= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id E694714484B; Thu, 7 Feb 2019 22:17:50 -0500 (EST) Received: from morphine.paradise.teonanacatl.net (unknown [47.202.93.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 4D3E7144847; Thu, 7 Feb 2019 22:17:49 -0500 (EST) From: Todd Zullinger To: git@vger.kernel.org Cc: Henning Schild Subject: [PATCH 1/2] t/lib-gpg: quote path to ${GNUPGHOME}/trustlist.txt Date: Thu, 7 Feb 2019 22:17:45 -0500 Message-Id: <20190208031746.22683-2-tmz@pobox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190208031746.22683-1-tmz@pobox.com> References: <20190208031746.22683-1-tmz@pobox.com> MIME-Version: 1.0 X-Pobox-Relay-ID: 1D86E0BA-2B50-11E9-80B6-DF19F34BB12D-09356542!pb-smtp2.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When gpgsm is installed, lib-gpg.sh attempts to update trustlist.txt to relax the checking of some root certificate requirements. The path to "${GNUPGHOME}" contains spaces which cause an "ambiguous redirect" warning when bash is used to run the tests: $ bash t7030-verify-tag.sh /git/t/lib-gpg.sh: line 66: ${GNUPGHOME}/trustlist.txt: ambiguous redirect ok 1 - create signed tags ok 2 # skip create signed tags x509 (missing GPGSM) ... No warning is issued when using bash called as /bin/sh, dash, or mksh. Quote the path to ensure the redirect works as intended and sets the GPGSM prereq. While we're here, drop the space after ">>". Signed-off-by: Todd Zullinger --- t/lib-gpg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh index f1277bef4f..207009793b 100755 --- a/t/lib-gpg.sh +++ b/t/lib-gpg.sh @@ -63,7 +63,7 @@ then cut -d" " -f4 | tr -d '\n' >"${GNUPGHOME}/trustlist.txt" && - echo " S relax" >> ${GNUPGHOME}/trustlist.txt && + echo " S relax" >>"${GNUPGHOME}/trustlist.txt" && (gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) && echo hello | gpgsm --homedir "${GNUPGHOME}" >/dev/null \ -u committer@example.com -o /dev/null --sign - 2>&1 && From patchwork Fri Feb 8 03:17:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Zullinger X-Patchwork-Id: 10802397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5335513BF for ; Fri, 8 Feb 2019 03:18:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AC162E5AC for ; Fri, 8 Feb 2019 03:18:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27F702E5DE; Fri, 8 Feb 2019 03:18:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B730B2E5AC for ; Fri, 8 Feb 2019 03:17:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726994AbfBHDR4 (ORCPT ); Thu, 7 Feb 2019 22:17:56 -0500 Received: from pb-smtp2.pobox.com ([64.147.108.71]:63103 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726983AbfBHDRy (ORCPT ); Thu, 7 Feb 2019 22:17:54 -0500 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 70CB714484E; Thu, 7 Feb 2019 22:17:52 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=sb0OmzuBB237boa9fug9dfJ3p +Y=; b=LbkKGH+rDWDH8601/t0hPiG4OKy27mQnB4TTVNqPEYubfxjmbDowmieAc 2jf1/cK2GFj6HcUuJKIV86zxGuvIR619KZjV6eSmSNqmaOZSoBGrdpUkTbGqHTkx HfPAMtdYLo8uQLdaTk5RqhVuohCPbg+Y/eTj+0il5xpruypE+I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; q=dns; s=sasl; b=d55wFmgECYFh376qPMk OUcAaZzB+dUEEUcXB5QpkTX5nDC6OgcBCmEjeYzbPB+Mu39R7P1TK+JqB8gXo0/H PppwkSi+DkuGPuNSbtQzvpEy4SxhxYMfTaoPtUSiaxUPYdIFEyCKtqbi9JI9bBaD koL/yeAMLiZQs3o+fZWsamwI= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 69FB014484D; Thu, 7 Feb 2019 22:17:52 -0500 (EST) Received: from morphine.paradise.teonanacatl.net (unknown [47.202.93.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id CCD5114484A; Thu, 7 Feb 2019 22:17:50 -0500 (EST) From: Todd Zullinger To: git@vger.kernel.org Cc: Henning Schild Subject: [PATCH 2/2] t/lib-gpg: drop redundant killing of gpg-agent Date: Thu, 7 Feb 2019 22:17:46 -0500 Message-Id: <20190208031746.22683-3-tmz@pobox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190208031746.22683-1-tmz@pobox.com> References: <20190208031746.22683-1-tmz@pobox.com> MIME-Version: 1.0 X-Pobox-Relay-ID: 1E6E206A-2B50-11E9-8C30-DF19F34BB12D-09356542!pb-smtp2.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In 53fc999306 ("gpg-interface t: extend the existing GPG tests with GPGSM", 2018-07-20), the gpgconf call which kills gpg-agent was copied from the existing gpg setup code. The reason for killing gpg-agent is given in 29ff1f8f74 ("t: lib-gpg: flush gpg agent on startup", 2017-07-20): When running gpg-relevant tests, a gpg-daemon is spawned for each GNUPGHOME used. This daemon may stay running after the test and cache file descriptors for the trash directories, even after the trash directory is removed. This leads to ENOENT errors when attempting to create files if tests are run multiple times. Add a cleanup script to force flushing the gpg-agent for that GNUPGHOME (if any) before setting up the GPG relevant-environment. Killing gpg-agent once per test is sufficient. Signed-off-by: Todd Zullinger --- t/lib-gpg.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh index 207009793b..8d28652b72 100755 --- a/t/lib-gpg.sh +++ b/t/lib-gpg.sh @@ -64,7 +64,6 @@ then tr -d '\n' >"${GNUPGHOME}/trustlist.txt" && echo " S relax" >>"${GNUPGHOME}/trustlist.txt" && - (gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) && echo hello | gpgsm --homedir "${GNUPGHOME}" >/dev/null \ -u committer@example.com -o /dev/null --sign - 2>&1 && test_set_prereq GPGSM