lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 9 Feb 2019 09:39:43 +0100
From:   Johannes Sixt <j6t@...g.org>
To:     Jeff King <peff@...f.net>,
        "Randall S. Becker" <rsbecker@...bridge.com>
Cc:     "'brian m. carlson'" <sandals@...stytoothpaste.net>,
        'Junio C Hamano' <gitster@...ox.com>, git@...r.kernel.org,
        'Linux Kernel' <linux-kernel@...r.kernel.org>,
        git-packagers@...glegroups.com
Subject: Re: [Breakage] Git v2.21.0-rc0 - t5318 (NonStop)

Am 09.02.19 um 05:24 schrieb Jeff King:
> On Fri, Feb 08, 2019 at 05:53:53PM -0500, Randall S. Becker wrote:
> 
>>> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index
>>> 92cf8f812c..4afab14431 100644
>>> --- a/t/test-lib-functions.sh
>>> +++ b/t/test-lib-functions.sh
>>> @@ -1302,3 +1302,8 @@ test_set_port () {
>>>  	port=$(($port + ${GIT_TEST_STRESS_JOB_NR:-0}))
>>>  	eval $var=$port
>>>  }
>>> +
>>> +# Generate an output of $1 bytes of all zeroes (NULs, not ASCII zeroes).
>>> +gen_zero_bytes () {
>>> +	perl -e 'print "\0" x $ARGV[0]' "$@"
>>> +}
>>
>> This function does work on platform, so it's good.
> 
> Great. Since it sounds like you're preparing some patches to deal with
> /dev/zero elsewhere, do you want to wrap it up in a patch as part of
> that?

Please do not use yes to generate an infinite amount of bytes. Our
implementation of yes() in test-lib.sh generates only 99 lines.

Perhaps do this.

----- 8< -----
Subject: [PATCH] t5318: avoid /dev/zero

Some platforms do not offer /dev/zero. Use printf and tr to generate
a certain amount of NUL bytes.

Reported-by: Randall S. Becker <rsbecker@...bridge.com>
Signed-off-by: Johannes Sixt <j6t@...g.org>
---
 t/t5318-commit-graph.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh
index 16d10ebce8..04d394274f 100755
--- a/t/t5318-commit-graph.sh
+++ b/t/t5318-commit-graph.sh
@@ -383,7 +383,8 @@ corrupt_graph_and_verify() {
 	cp $objdir/info/commit-graph commit-graph-backup &&
 	printf "$data" | dd of="$objdir/info/commit-graph" bs=1 seek="$pos" conv=notrunc &&
 	dd of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" count=0 &&
-	dd if=/dev/zero of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" count=$(($orig_size - $zero_pos)) &&
+	printf "%0*d" $(($orig_size - $zero_pos)) 0 | tr 0 '\0' |
+		dd of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" &&
 	test_must_fail git commit-graph verify 2>test_err &&
 	grep -v "^+" test_err >err &&
 	test_i18ngrep "$grepstr" err
-- 
2.20.1.86.gb0de946387

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ