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

Re: read_branches_file ()

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Feb 8, 2008, 17:18 UTC
Message-ID
<alpine.LNX.1.00.0802081213340.13593@iabervon.org>
In-Reply-To
<20080208165008.52630d36@pc09.procura.nl>
On Fri, 8 Feb 2008, H.Merijn Brand wrote:
Show 16 quoted lines
> I'm (again) trying to port git-1.5.4 to HP-UX, and I've already got rather
> far, but I'm hitting some stuff I cannot explain.
> 
> t5405-send-pack-rewind.sh fails the 'git fetch .. master:master' part in
> the setup, as deep down, read_branches_file () is called with in remote
> the name "..".
> 
> The file that it tries to open using git_path () is ".git/branches/.."
> That is weird. That is not a file, but a dir. "../.git/branches" would
> be more logical, but whatever. HP-UX 11.00 will gladly return a valid
> FILE * for opening a directory with fopen (), which, when read, will
> return anything but what is expected. So, maybe read_branches_file ()
> should be protected against opening anything but files. Maybe with some
> stat () and S_ISREG ()'s.
> 
> Or has something gone wrong earlier on?

It's doing this because it thinks you might have a remote configured with the name "..", which should probably be blocked at a higher level, if only for general sanity.

	-Daniel
*This .sig left intentionally blank*
Previous: H.Merijn Brand
Message 7 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.