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

Re: [PATCH v2] contrib: added git-diffall

From
Stefano Lattarini <stefano.lattarini@gmail.com>
Date
Feb 23, 2012, 09:56 UTC
Message-ID
<4F460D45.7000804@gmail.com>
In-Reply-To
<7vipiy8m5q.fsf@alter.siamese.dyndns.org>
Hello everybody.  Hope you don't mind 2 cents from an outsider ...
On 02/23/2012 12:48 AM, Junio C Hamano wrote:
Show 16 quoted lines
>
> Tim Henigan <tim.henigan@gmail.com> writes:
> 
>> +# mktemp is not available on all platforms (missing from msysgit)
>> +# Use a hard-coded tmp dir if it is not available
>> +tmp="$(mktemp -d -t tmp.XXXXXX 2>/dev/null)" || {
>> +	tmp=/tmp/git-diffall-tmp
>> +}
> 
> It would not withstand malicious attacks, but doing
> 
> 	tmp=/tmp/git-diffall-tmp.$$
> 
> would at least protect you from accidental name crashes better in the
> fallback codepath.
>

Maybe this would be enough to withstand malicious attacks (even if not denial-of-service attacks):

  # mktemp is not available on all platforms (missing from msysgit)
   tmp=$(mktemp -d -t tmp.XXXXXX 2>/dev/null) || {
       tmp=/tmp/git-diffall-tmp.$$
       mkdir "$tmp" || fatal "couldn't create temporary directory"
  }
> 
>> +mkdir -p "$tmp"
>
At which point this should be removed, of course.
Regards,
  Stefano
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 8 in “contrib: added git-diffall”
  1. contrib: added git-diffallTim Henigan, Feb 22, 2012
  2. Junio C HamanoFeb 22, 2012
  3. Stefano LattariniFeb 23, 2012
  4. Junio C HamanoFeb 23, 2012
  5. Tim HeniganFeb 23, 2012
  6. Junio C HamanoFeb 23, 2012
  7. Matt McClureApr 10, 2012
  8. David AguilarApr 11, 2012

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.