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

Re: [Bug] Permissions of temp file created in git's sha1_file.c correct?

From
DHDaniel Höpfl <daniel@hoepfl.de>
Date
Feb 2, 2011, 13:25 UTC
Message-ID
<0bd60a95adcc1cda50d6ff0e8d335216@kloeckner.org>
In-Reply-To
<m3vd128uz7.fsf@localhost.localdomain>

On Wed, 02 Feb 2011 04:47:20 -0800 (PST), Jakub Narebski <jnareb@gmail.com> wrote:

> That is why there is `core.fileMode` config variable, see git-config(1)
> manpage:

I saw (and liked) that option but I do not want to use the executable bit on my "FAT-compatible" file system for other things anyways.

> Didin't git detect that it was on such filesystem?

I did not create the repository on the device, it was simply copied onto the volume. One `git init` later: Git detects that the filesystem knows about the executable flag and sets filemode = true. (On a real FAT, it would be set to false, of course).

> Not true.  Whether file can be renamed or deleted is governed by
> permissions in directory that contains given file, not the file itself
> (at least on POSIX).  If I understand things correctly, of course.
OK, then that's a reason to fix my implementation. (Done.)

I still think that a file that is to be written to should not be created without the right to do so.

> Note that git doesn't store full permissions, in particular read/write
> permissions, only executable bit and "is symlink" thing.

Executable is all I need. Since there was only one bit left in the FAT directory entries, my file system uses this bit to store the executable flag. Writeable is derived from/mapped to !readonly. That's all I changed, compared to a normal FAT.

Thanks for the very fast answer,
   Daniel
Previous: Jakub Narebski
Message 3 of 3 in “[Bug] Permissions of temp file created in git's sha1_file.c correct?”
  1. Daniel HöpflFeb 2, 2011
  2. Jakub NarebskiFeb 2, 2011
  3. Daniel HöpflFeb 2, 2011

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.