From: Todd Zullinger <tmz@pobox.com> To: Junio C Hamano <gitster@pobox.com> Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>, "SZEDER Gábor" <szeder.dev@gmail.com>, git@vger.kernel.org, "Sebastian Staudt" <koraktor@gmail.com>, "Josh Steadmon" <steadmon@google.com>, "Johannes Schindelin" <Johannes.Schindelin@gmx.de> Subject: Re: [PATCH 2/2] commit-graph tests: fix cryptic unportable "dd" invocation Date: Fri, 22 Feb 2019 13:35:53 -0500 Message-ID: <20190222183553.GA16125@zaya.teonanacatl.net> (raw) In-Reply-To: <xmqqbm33r7zl.fsf@gitster-ct.c.googlers.com> Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes: > >> It was my reading of the seek=* section ("the implementation shall seek >> to the specified offset"). I didn't spot that bit covered in of=*. Yeah, >> I see that's defined & safe after reading that. > > OK, so... > > -- >8 -- > From: Ævar Arnfjörð Bjarmason <avarab@gmail.com> > Date: Thu, 21 Feb 2019 20:28:49 +0100 > Subject: [PATCH] commit-graph tests: fix cryptic unportable "dd" invocation > > Change an unportable invocation of "dd" with count=0, that wanted to > truncate the commit-graph file. In POSIX it is unspecified what > happens when count=0 is provided[1]. The NetBSD "dd" behavior > differs from GNU (and seemingly other BSDs), which as left this test s/ as/ has/ ? > broken since d2b86fbaa1 ("commit-graph: fix buffer read-overflow", > 2019-01-15). > > Copying from /dev/null would seek/truncate to seek=$zero_pos and > stop immediately after that (without being able to copy anything), > which is the right way to truncate the file. > > 1. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/dd.html > > Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> > Helped-by: SZEDER Gábor <szeder.dev@gmail.com> > Signed-off-by: Junio C Hamano <gitster@pobox.com> > --- > t/t5318-commit-graph.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh > index d4bd1522fe..561796f280 100755 > --- a/t/t5318-commit-graph.sh > +++ b/t/t5318-commit-graph.sh > @@ -382,7 +382,7 @@ corrupt_graph_and_verify() { > test_when_finished mv commit-graph-backup $objdir/info/commit-graph && > 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 of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" if=/dev/null && > generate_zero_bytes $(($orig_size - $zero_pos)) >>"$objdir/info/commit-graph" && > test_must_fail git commit-graph verify 2>test_err && > grep -v "^+" test_err >err && -- Todd
next prev parent reply other threads:[~2019-02-22 18:36 UTC|newest] Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-02-19 23:29 [ANNOUNCE] Git v2.21.0-rc2 Junio C Hamano 2019-02-20 0:43 ` Randall S. Becker 2019-02-20 19:41 ` Junio C Hamano 2019-02-20 20:46 ` Johannes Schindelin 2019-02-21 13:10 ` Duy Nguyen 2019-02-21 23:55 ` brian m. carlson 2019-02-22 9:13 ` Duy Nguyen 2019-02-21 15:54 ` Randall S. Becker 2019-02-21 20:04 ` Junio C Hamano 2019-02-21 21:06 ` SZEDER Gábor 2019-02-21 21:30 ` Randall S. Becker 2019-02-21 19:59 ` Randall S. Becker 2019-02-21 10:46 ` Git for Windows v2.21.0-rc2, was " Johannes Schindelin 2019-02-21 19:28 ` [PATCH 0/2] BSD portability fixes for 2.21.0-rc2 Ævar Arnfjörð Bjarmason 2019-02-22 0:37 ` Josh Steadmon 2019-02-21 19:28 ` [PATCH 1/2] tests: fix unportable "\?" and "\+" regex syntax Ævar Arnfjörð Bjarmason 2019-02-22 5:00 ` Junio C Hamano 2019-02-21 19:28 ` [PATCH 2/2] commit-graph tests: fix cryptic unportable "dd" invocation Ævar Arnfjörð Bjarmason 2019-02-21 20:43 ` SZEDER Gábor 2019-02-21 22:26 ` Ævar Arnfjörð Bjarmason 2019-02-22 10:50 ` SZEDER Gábor 2019-02-22 14:34 ` Ævar Arnfjörð Bjarmason 2019-02-22 18:30 ` Junio C Hamano 2019-02-22 18:35 ` Todd Zullinger [this message] 2019-02-22 19:23 ` [PATCH v3] commit-graph tests: fix " Junio C Hamano
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style List information: http://vger.kernel.org/majordomo-info.html * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190222183553.GA16125@zaya.teonanacatl.net \ --to=tmz@pobox.com \ --cc=Johannes.Schindelin@gmx.de \ --cc=avarab@gmail.com \ --cc=git@vger.kernel.org \ --cc=gitster@pobox.com \ --cc=koraktor@gmail.com \ --cc=steadmon@google.com \ --cc=szeder.dev@gmail.com \ --subject='Re: [PATCH 2/2] commit-graph tests: fix cryptic unportable "dd" invocation' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
git@vger.kernel.org list mirror (unofficial, one of many) This inbox may be cloned and mirrored by anyone: git clone --mirror https://public-inbox.org/git git clone --mirror http://ou63pmih66umazou.onion/git git clone --mirror http://czquwvybam4bgbro.onion/git git clone --mirror http://hjrcffqmbrq6wope.onion/git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V1 git git/ https://public-inbox.org/git \ git@vger.kernel.org public-inbox-index git Example config snippet for mirrors. Newsgroups are available over NNTP: nntp://news.public-inbox.org/inbox.comp.version-control.git nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git nntp://news.gmane.io/gmane.comp.version-control.git note: .onion URLs require Tor: https://www.torproject.org/ code repositories for project(s) associated with this inbox: https://80x24.org/mirrors/git.git AGPL code for this site: git clone https://public-inbox.org/public-inbox.git