git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] mktag.c: improve verification of tagger field and tests

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Mar 26, 2008, 21:03 UTC
Message-ID
<47EABA21.90708@nrlssc.navy.mil>
In-Reply-To
<7vhcete8oi.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
> By the way, I
>    think tagger information should get the same validation as committer
>    and author information gets elsewhere in the system;

I agree. Do you have any pointers to suggest? I haven't seen any place in the code that does thorough validation. Usually, these fields are generated within git, or converted to the internal form using some dwim procedure.

I keyed on get_ac_line() in builtin-blame.c and force_author in builtin-commit.c

builtin-commit.c searches for the angle brackets '<' and '>' as a validation for the argument to --author.

get_ac_line() searches from the end of the string and sets tz, timestamp, and email to the last space-separated entries. timestamp is fed to strtoul and tz is fed to atoi. These two both skip leading space, but they are never fed leading space from get_ac_line().

date.c:parse_date() keys on +\- to recognize timezone.

I think I'll make all of the optional components non-optional and make the format a little stricter.

-brandon
Previous: Junio C HamanoNext: Brandon Casey
Message 7 of 12 in “mktag.c: improve verification of tagger field and tests”
  1. mktag.c: improve verification of tagger field and testsBrandon Casey, Mar 26, 2008
  2. Brandon CaseyMar 26, 2008
  3. Carlos RicaMar 26, 2008
  4. Brandon CaseyMar 26, 2008
  5. Brandon CaseyMar 26, 2008
  6. Junio C HamanoMar 26, 2008
  7. Brandon CaseyMar 26, 2008
  8. mktag.c: improve verification of tagger field and testsBrandon Casey, Mar 27, 2008
  9. Junio C HamanoMar 31, 2008
  10. Brandon CaseyMar 31, 2008
  11. mktag.c: tweak validation of tagger field and adjust test scriptBrandon Casey, Mar 31, 2008
  12. Junio C HamanoApr 1, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.