From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id ABE911F723 for ; Wed, 13 Dec 2023 00:50:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1702428621; bh=g09XVh01CER4NotdkFjd+MbtMVtar2AX+T4aUrlLN+M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xFi1mp5+XQeZ7+nqRVaHkg3XtMINw4GtpVZ7JZXTm4E8UXQo4du7S2O1QmZ3L359G TmP/2kxq3u8b22GP76fqUxakyBPsZP5frKjUtqvK/lfZZa7ZDx0dkLIQfBGqWtmwvV WUnOh/b3qvEM/mWv8r6BQE0vS6WofLeW7sdoBPLU= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 11/14] t/convert-compact: allow S_ISGID bit Date: Wed, 13 Dec 2023 00:50:16 +0000 Message-ID: <20231213005019.26912-12-e@80x24.org> In-Reply-To: <20231213005019.26912-1-e@80x24.org> References: <20231213005019.26912-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: My user home directory on Alpine has S_ISGID set on it and every subdirectory inherits it. This includes my work tree and the t/data-gen/* subdirectories. So just ignore the presence (or non-presence) of the S_ISGID bit on directories descended from the cached t/data-gen/* directories. Now, public-inbox-convert may want to preserve S_ISGID on the newly-created v2 inbox, but that's a separate discussion. --- t/convert-compact.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/convert-compact.t b/t/convert-compact.t index c7b7f77e..b123f17b 100644 --- a/t/convert-compact.t +++ b/t/convert-compact.t @@ -35,14 +35,14 @@ EOF $im->add($eml) or BAIL_OUT '->add'; }; umask(077) or BAIL_OUT "umask: $!"; -oct_is(((stat("$ibx->{inboxdir}/public-inbox"))[2]) & 07777, 0755, +oct_is(((stat("$ibx->{inboxdir}/public-inbox"))[2]) & 05777, 0755, 'sharedRepository respected for v1'); -oct_is(((stat("$ibx->{inboxdir}/public-inbox/msgmap.sqlite3"))[2]) & 07777, +oct_is(((stat("$ibx->{inboxdir}/public-inbox/msgmap.sqlite3"))[2]) & 05777, 0644, 'sharedRepository respected for v1 msgmap'); my @xdir = glob("$ibx->{inboxdir}/public-inbox/xap*/*"); foreach (@xdir) { my @st = stat($_); - oct_is($st[2] & 07777, -f _ ? 0644 : 0755, + oct_is($st[2] & 05777, -f _ ? 0644 : 0755, 'sharedRepository respected on file after convert'); } @@ -55,7 +55,7 @@ ok(run_script($cmd, undef, $rdr), 'v1 compact works'); @xdir = glob("$ibx->{inboxdir}/public-inbox/xap*"); is(scalar(@xdir), 1, 'got one xapian directory after compact'); -oct_is(((stat($xdir[0]))[2]) & 07777, 0755, +oct_is(((stat($xdir[0]))[2]) & 05777, 0755, 'sharedRepository respected on v1 compact'); my $hwm = do { @@ -71,7 +71,7 @@ ok(run_script($cmd, undef, $rdr), 'convert --no-index works'); $cmd = [ '-convert', $ibx->{inboxdir}, "$tmpdir/x/v2" ]; ok(run_script($cmd, undef, $rdr), 'convert works'); @xdir = glob("$tmpdir/x/v2/xap*/*"); -foreach (@xdir) { +for (@xdir) { # TODO: should public-inbox-convert preserve S_ISGID bit? my @st = stat($_); oct_is($st[2] & 07777, -f _ ? 0644 : 0755, 'sharedRepository respected after convert');