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

Re: safe.directory warnings for root-owned repositories

From
MOMichael Orlitzky <michael@orlitzky.com>
Date
Oct 31, 2024, 12:15 UTC
Message-ID
<ZyN03D8os53XJGDo@mertle>
In-Reply-To
<D59QZ1P3KSNB.ZXDHUA5HGC97@pm.me>
On 2024-10-31 05:38:00, Caleb White wrote:
Show 9 quoted lines
> 
> The dubious ownership check simply reports that the directory is owned by
> someone other than the user running the command, with no special handling
> for the root user. While the error might not make the most sense in this
> context, I'm not sure that it's worth special-casing the root user
> (really the user with id = 0 as it might not be named `root`) in the
> implementation.
> 
> Why would you initialize a repository as `root` in the first place?
To avoid the dubious ownership warning, obviously :)

These are shared repositories that I and my coworkers push to over SSH. Write access is granted via ACLs, with ownership being mostly irrelevant. (This is still "unsafe," but not for the stated reason.)

I don't necessarily have a problem with adding O(m*n) safe.directory entries, but every once in a while someone will ask me about it, and I don't have a good answer for why it's not safe to push to a repository that's owned by root. I guess it's just more annoying to have to override the warning when the warning is wrong. Though if it was changed to "dubious repository writability," I wouldn't be able to complain any more.

Previous: Caleb WhiteNext: Taylor Blau
Message 3 of 4 in “safe.directory warnings for root-owned repositories”
  1. Michael OrlitzkyOct 31, 2024
  2. Caleb WhiteOct 31, 2024
  3. Michael OrlitzkyOct 31, 2024
  4. Taylor BlauOct 31, 2024

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.