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

Re: [PATCH] C version of git-count-objects

From
MWMorten Welinder <mwelinder@gmail.com>
Date
Apr 27, 2006, 13:16 UTC
Message-ID
<118833cc0604270616u2961ab10waef5807c429be784@mail.gmail.com>
In-Reply-To
<20060427101254.GA22769@peppar.cs.umu.se>
> +                       if (access(subdir, R_OK | X_OK))
> +                               continue;
> +                       chdir(subdir);

You've got yourself a needless race condition right there. Just do the chdir and check the return value. (And besides, access checks with the wrong set of permissions, should this ever end up in set[ug]id context.)

Morten
Previous: Peter HagervallNext: Nicolas Pitre
Message 2 of 12 in “C version of git-count-objects”
  1. C version of git-count-objectsPeter Hagervall, Apr 27, 2006
  2. Morten WelinderApr 27, 2006
  3. Nicolas PitreApr 27, 2006
  4. C version of git-count-objects, second tryPeter Hagervall, Apr 27, 2006
  5. Junio C HamanoApr 27, 2006
  6. Nicolas PitreApr 27, 2006
  7. Peter HagervallApr 27, 2006
  8. Linus TorvaldsApr 27, 2006
  9. Peter HagervallApr 27, 2006
  10. Junio C HamanoApr 27, 2006
  11. Peter HagervallApr 28, 2006
  12. Junio C HamanoApr 28, 2006

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.