git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* safe.directory warnings for root-owned repositories
@ 2024-10-31  4:23 Michael Orlitzky
  2024-10-31  5:38 ` Caleb White
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Orlitzky @ 2024-10-31  4:23 UTC (permalink / raw)
  To: git

If I create a new repository as root,

  $ sudo git init
  Initialized empty Git repository in /home/mjo/tmp/.git/

  $ ls -alh
  total 12K
  drwxr-xr-x  3 mjo  mjo  4.0K 2024-10-31 00:09 .
  drwxr-x--- 17 mjo  mjo  4.0K 2024-10-31 00:07 ..
  drwxr-xr-x  6 root root 4.0K 2024-10-31 00:09 .git

and attempt to do anything in it, I get a safe.directory warning:

  $ git status
  fatal: detected dubious ownership in repository at '/home/mjo/tmp'
  ...

Does that make sense? In terms of ownership, root:root is as safe as
it gets.

I'm aware that safe.directory is only scratching the surface of these
"doing things in a directory that someone else can write to" exploits,
but within the limited scope of this one feature, root ownership does
not strike me as particularly dubious.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-10-31 20:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-31  4:23 safe.directory warnings for root-owned repositories Michael Orlitzky
2024-10-31  5:38 ` Caleb White
2024-10-31 12:15   ` Michael Orlitzky
2024-10-31 20:04     ` Taylor Blau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).