From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2 0/6] Improve tag checking in fsck and with transfer.fsckobjects
Date: Wed, 10 Sep 2014 14:31:00 -0700 [thread overview]
Message-ID: <xmqqsijzf9ij.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <xmqq7g1bgp5r.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Wed, 10 Sep 2014 14:07:44 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
>
>> This patch series introduces detailed checking of tag objects when calling
>> git fsck, and also when transfer.fsckobjects is set to true.
>>
>> To this end, the fsck machinery is reworked to accept the buffer and size
>> of the object to check, and for commit and tag objects, we verify that the
>> buffers contain an end of header (i.e. an empty line) to guarantee that our
>> checks do not run beyond the buffer.
>
> Overall they looked sensible and I am trying to queue them on 'pu'
> for today's pushout.
>
> Thanks.
I was expecting to see interesting interactions with the "oops, fsck
was not exiting with non-zero status in some cases" fix by Peff with
the patch 5/6 of this series that adds two new tests to t1450, but
because the breakage in these two cases are both only warning-events
and not error-events, I didn't prefix "git fsck" with test_must_fail
after all.
Are there some more serious kind of breakages that the new code
actually catches as errors which the new tests are not exercising?
The second test however did need the fix I mentioned in the review
to skip ident validation when we know the buffer does not point at a
potential ident to pass, though (see below, which is what I queued
on the tip of your series as a "SQUASH???" single fix-up patch).
Please do an equivalent in the individual patches that introduce
these buglets in a reroll (i.e. not like I did here, which was done
this way only because I needed to make sure that day's integration
result passes the test suite with minimum effort on my end ;-)).
Thanks.
fsck.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/fsck.c b/fsck.c
index 8341a30..6e6ea25 100644
--- a/fsck.c
+++ b/fsck.c
@@ -248,14 +248,14 @@ static int require_end_of_header(const void *data, unsigned long size,
switch (buffer[i]) {
case '\0':
return error_func(obj, FSCK_ERROR,
- "invalid message: NUL at offset %d", i);
+ "invalid header: NUL at offset %d", i);
case '\n':
if (i + 1 < size && buffer[i + 1] == '\n')
return 0;
}
}
- return error_func(obj, FSCK_ERROR, "invalid buffer: missing empty line");
+ return error_func(obj, FSCK_ERROR, "invalid buffer: missing end of header");
}
static int fsck_ident(const char **ident, struct object *obj, fsck_error error_func)
@@ -426,14 +426,16 @@ static int fsck_tag_buffer(struct tag *tag, const char *data,
error_func(&tag->object, FSCK_WARN, "invalid 'tag' name: %s", buffer);
buffer = eol + 1;
- if (!skip_prefix(buffer, "tagger ", &buffer)) {
+ if (!skip_prefix(buffer, "tagger ", &buffer))
/* early tags do not contain 'tagger' lines; warn only */
- error_func(&tag->object, FSCK_WARN, "invalid format - expected 'tagger' line");
- }
- ret = fsck_ident(&buffer, &tag->object, error_func);
+ error_func(&tag->object, FSCK_WARN,
+ "invalid format - expected 'tagger' line");
+ else
+ ret = fsck_ident(&buffer, &tag->object, error_func);
done:
free(to_free);
+ strbuf_release(&sb);
return ret;
}
--
2.1.0-451-g8daadf2
next prev parent reply other threads:[~2014-09-10 21:31 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-28 14:46 [PATCH 0/6] Improve tag checking in fsck and with transfer.fsckobjects Johannes Schindelin
2014-08-28 14:46 ` [PATCH 1/6] Refactor type_from_string() to avoid die()ing in case of errors Johannes Schindelin
2014-08-28 20:43 ` Junio C Hamano
2014-08-28 14:46 ` [PATCH 2/6] Accept object data in the fsck_object() function Johannes Schindelin
2014-08-28 20:47 ` Junio C Hamano
2014-08-29 23:10 ` Jeff King
2014-08-29 23:05 ` Jeff King
2014-08-28 14:46 ` [PATCH 3/6] Make sure fsck_commit_buffer() does not run out of the buffer Johannes Schindelin
2014-08-28 20:59 ` Junio C Hamano
2014-08-29 23:27 ` Jeff King
2014-08-28 14:46 ` [PATCH 4/6] fsck: check tag objects' headers Johannes Schindelin
2014-08-28 21:25 ` Junio C Hamano
2014-08-28 21:36 ` Junio C Hamano
2014-08-29 23:46 ` Jeff King
2014-08-31 22:46 ` Junio C Hamano
2014-09-03 22:29 ` Jeff King
2014-09-03 23:14 ` Junio C Hamano
2014-09-04 2:04 ` Jeff King
2014-08-29 23:43 ` Jeff King
2014-09-02 18:41 ` Junio C Hamano
2014-09-03 21:38 ` Jeff King
2014-08-28 14:46 ` [PATCH 5/6] Add regression tests for stricter tag fsck'ing Johannes Schindelin
2014-08-28 14:47 ` [PATCH 6/6] Make sure that index-pack --strict fails upon invalid tag objects Johannes Schindelin
2014-09-10 13:52 ` [PATCH v2 0/6] Improve tag checking in fsck and with transfer.fsckobjects Johannes Schindelin
2014-09-10 13:58 ` Johannes Schindelin
2014-09-10 21:07 ` Junio C Hamano
2014-09-10 21:31 ` Junio C Hamano [this message]
2014-09-11 14:20 ` Johannes Schindelin
2014-09-11 14:26 ` [PATCH v3 " Johannes Schindelin
2014-09-11 14:26 ` [PATCH v3 1/6] Refactor type_from_string() to avoid die()ing in case of errors Johannes Schindelin
2014-09-11 14:26 ` [PATCH v3 2/6] Accept object data in the fsck_object() function Johannes Schindelin
2014-09-11 14:26 ` [PATCH v3 3/6] Make sure fsck_commit_buffer() does not run out of the buffer Johannes Schindelin
2014-09-11 14:26 ` [PATCH v3 4/6] fsck: check tag objects' headers Johannes Schindelin
2014-09-11 14:26 ` [PATCH v3 5/6] Add regression tests for stricter tag fsck'ing Johannes Schindelin
2014-09-11 14:26 ` [PATCH v3 6/6] Make sure that index-pack --strict checks tag objects Johannes Schindelin
2014-09-11 17:58 ` Junio C Hamano
2014-09-11 21:16 ` Junio C Hamano
2014-09-11 21:17 ` [PATCH 0/3] hash-object --literally Junio C Hamano
2014-09-11 21:17 ` [PATCH 1/3] hash-object: reduce file-scope statics Junio C Hamano
2014-09-11 21:17 ` [PATCH 2/3] hash-object: pass 'write_object' as a flag Junio C Hamano
2014-09-11 21:17 ` [PATCH 3/3] hash-object: add --literally option Junio C Hamano
2014-09-12 8:04 ` [PATCH v3 6/6] Make sure that index-pack --strict checks tag objects Johannes Schindelin
2014-09-12 8:07 ` [PATCH v4 0/6] Improve tag checking in fsck and with transfer.fsckobjects Johannes Schindelin
2014-09-12 8:07 ` [PATCH v4 1/6] Refactor type_from_string() to avoid die()ing in case of errors Johannes Schindelin
2014-09-12 8:07 ` [PATCH v4 2/6] Accept object data in the fsck_object() function Johannes Schindelin
2014-09-12 8:07 ` [PATCH v4 3/6] Make sure fsck_commit_buffer() does not run out of the buffer Johannes Schindelin
2014-09-12 8:08 ` [PATCH v4 4/6] fsck: check tag objects' headers Johannes Schindelin
2014-09-12 8:08 ` [PATCH v4 5/6] Add regression tests for stricter tag fsck'ing Johannes Schindelin
2014-09-12 8:08 ` [PATCH v4 6/6] Make sure that index-pack --strict checks tag objects Johannes Schindelin
2014-09-12 18:02 ` [PATCH v4 0/6] Improve tag checking in fsck and with transfer.fsckobjects Junio C Hamano
2014-09-13 9:08 ` Johannes Schindelin
[not found] ` <cover.1410356761.git.johannes.schindelin@gmx.de>
2014-09-10 13:52 ` [PATCH v2 1/6] Refactor type_from_string() to avoid die()ing in case of errors Johannes Schindelin
2014-09-10 13:52 ` [PATCH v2 2/6] Accept object data in the fsck_object() function Johannes Schindelin
2014-09-10 13:52 ` [PATCH v2 3/6] Make sure fsck_commit_buffer() does not run out of the buffer Johannes Schindelin
2014-09-10 17:43 ` Junio C Hamano
2014-09-11 11:59 ` Johannes Schindelin
2014-09-11 16:49 ` Junio C Hamano
2014-09-10 20:45 ` Eric Sunshine
2014-09-10 13:53 ` [PATCH v2 4/6] fsck: check tag objects' headers Johannes Schindelin
2014-09-10 17:52 ` Junio C Hamano
2014-09-10 13:53 ` [PATCH v2 5/6] Add regression tests for stricter tag fsck'ing Johannes Schindelin
2014-09-10 17:56 ` Junio C Hamano
2014-09-11 14:15 ` Johannes Schindelin
2014-09-10 13:53 ` [PATCH v2 6/6] Make sure that index-pack --strict fails upon invalid tag objects Johannes Schindelin
2014-09-10 21:54 ` Junio C Hamano
2014-09-11 14:22 ` Johannes Schindelin
2014-09-11 16:50 ` Junio C Hamano
2014-09-11 17:04 ` Johannes Schindelin
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqsijzf9ij.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.