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

Re: read_branches_file ()

From
H.Merijn Brand <h.m.brand@xs4all.nl>
Date
Feb 11, 2008, 10:17 UTC
Message-ID
<20080211111741.2269f89b@pc09.procura.nl>
In-Reply-To
<47B01CD4.4040004@op5.se>
On Mon, 11 Feb 2008 11:00:52 +0100, Andreas Ericsson <ae@op5.se> wrote:
Show 6 quoted lines
> 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))
Yes, see several follow-ups in this thread.
> ?
> 
> Otherwise, you might end up opening a FIFO, a socket or a
> block/char special, which is obviously undesired.

At the moment of the patch I was unsure if these were supported :) At least FIFO's and character devices are less error-prone than DIR's

-- 
H.Merijn Brand         Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using & porting perl 5.6.2, 5.8.x, 5.10.x  on HP-UX 10.20, 11.00, 11.11,
& 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin.       http://qa.perl.org
http://mirrors.develooper.com/hpux/            http://www.test-smoke.org
                        http://www.goldmark.org/jeff/stupid-disclaimers/
Previous: Andreas EricssonNext: Daniel Barkalow
Message 6 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.