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

Re: [PATCH] Preserve the protection mode for the Git config files

From
Nanako Shiraishi <nanako3@lavabit.com>
Date
Jul 22, 2009, 22:08 UTC
Message-ID
<20090723070815.6117@nanako3.lavabit.com>
In-Reply-To
<7vab2wlh4y.fsf@alter.siamese.dyndns.org>
Quoting Junio C Hamano <gitster@pobox.com>
Show 22 quoted lines
> This change in behaviour is justifiable only because the only thing the
> user who said "core.sharedrepository = true" cares about is that refs are
> readable by the group members (otherwise s/he would have used a more
> explicit setting like "core.sharedrepository = 0660", and the
> adjust_shared_perm() code will do the right thing, with or without your
> patch).
>
> The patch description must defend itself a bit better, perhaps by saying
> something like this at the end.
>
> 	This patch touches the codepath that affects not just .git/config
> 	but other files like the index and the loose refs, so they also
> 	inherit the original protection bits.  In a private repository,
> 	this is not an issue exactly because the repository is private,
>
> 	In a shared repository, a later call made in this function to
> 	adjust_shared_perm() widens the permission bits as configured.
> 	Because adjust_shared_perm() is designed to do so from any mode
> 	limited by user's umask, even though this patch changes the
> 	behaviour in the strict sense, it should not affect the outcome in
> 	a negative way and what is explicitly marked as allowed in the
> 	configuration will still be allowed.
I have two questions.
1. Why would you keep sensitive information in the config file in the first place? Wouldn't it be better to introduce a level of indirection, making a variable in the config file to point to a private file only you can read and store secrets in the latter?
2. Why is your config file more secret than your history? Wouldn't it solve your problem without any patch if you set core.sharedrepository to 0600?
-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Previous: Junio C HamanoNext: Johannes Schindelin
Message 3 of 5 in “Preserve the protection mode for the Git config files”
  1. Preserve the protection mode for the Git config filesCatalin Marinas, Jul 21, 2009
  2. Junio C HamanoJul 22, 2009
  3. Nanako ShiraishiJul 22, 2009
  4. Johannes SchindelinJul 22, 2009
  5. Catalin MarinasJul 27, 2009

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.