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

Re: read_branches_file ()

From
Andreas Ericsson <ae@op5.se>
Date
Feb 11, 2008, 10:00 UTC
Message-ID
<47B01CD4.4040004@op5.se>
In-Reply-To
<20080208170305.069d43d2@pc09.procura.nl>
H.Merijn Brand wrote:
> -       if (!f)
> +       if (stat (gp, &st_buf) || S_ISDIR (st_buf.st_mode))
Shouldn't this be
	if (stat(gp, &st_buf) || !S_ISREG(st_buf.st_mode))
?

Otherwise, you might end up opening a FIFO, a socket or a block/char special, which is obviously undesired.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: H.Merijn BrandNext: H.Merijn Brand
Message 5 of 7 in “read_branches_file ()”
  1. H.Merijn BrandFeb 8, 2008
  2. H.Merijn BrandFeb 8, 2008
  3. Johannes SchindelinFeb 8, 2008
  4. H.Merijn BrandFeb 8, 2008
  5. Andreas EricssonFeb 11, 2008
  6. H.Merijn BrandFeb 11, 2008
  7. Daniel BarkalowFeb 8, 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.