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

Re: git-shell vs "detected dubious ownership in repository"

From
Carlisle T. Hamlin <hamlin.carlisle@gmx.com>
Date
May 27, 2024, 21:35 UTC
Message-ID
<d3983115-bcf5-4ed2-b47a-56af297b6a9c@gmx.com>
In-Reply-To
<14ed85d8-dccb-4928-a4b8-a099d151fe5b@aixigo.com>
Hiya, Harald.

I'm not sure if this is intended behaviour, but I've always ever had that problem running my own servers when the group does not have write access to the directory containing the repository.

You might, as a troubleshooting step, try giving the group write access and see if that makes the problem go away.

Alternatively, you could also just add the directory as an exception using the command provided.

On 5/21/24 01:40, Harald Dunkel wrote:
Show 53 quoted lines
> Hi folks,
> 
> since 2.45.1 (upgraded from 2.40.something) I cannot pull my
> etckeeper repositories anymore:
> 
>      # su - etckeeper
>      % cd /archive/host.example.com
>      % git remote -v
>      origin  host.example.com:/etc (fetch)
>      origin  host.example.com:/etc (push)
>      % git pull
>      fatal: detected dubious ownership in repository at '/etc/.git'
>      To add an exception for this directory, call:
> 
>              git config --global --add safe.directory /etc/.git
>      fatal: Could not read from remote repository.
> 
>      Please make sure you have the correct access rights
>      and the repository exists.
> 
> Please note there is git-shell on the remote side. Question is,
> what is dubious about the existing access bits of the remote repo?
> Currently I have
> 
>      root@host.example.com:/etc/.git# ls -al
>      total 532
>      drwxr-s---   8 root etckeeper   4096 May 21 10:14 .
>      drwxr-xr-x 242 root root       20480 May 18 06:28 ..
>      -rw-r-s---   1 root etckeeper   2716 May 17 14:04 COMMIT_EDITMSG
>      -rw-r-s---   1 root etckeeper     23 Jun  5  2013 HEAD
>      drwxr-s---   2 root etckeeper   4096 Jun  5  2013 branches
>      -rw-r-s---   1 root etckeeper     92 Jun  5  2013 config
>      -rw-r-s---   1 root etckeeper     37 Jun  5  2013 description
>      -rw-r-s---   1 root etckeeper  70979 Jun 28  2021 gitk.cache
>      drwxr-s---   2 root etckeeper   4096 Jun  5  2013 hooks
>      -rw-r-----   1 root etckeeper 397408 May 21 10:14 index
>      drwxr-s---   2 root etckeeper   4096 Jul 11  2023 info
>      drwxr-s---   3 root etckeeper   4096 Jul 11  2023 logs
>      drwxr-s--- 260 root etckeeper   4096 May 17 14:04 objects
>      -rw-r-s---   1 root etckeeper    105 Jul 11  2023 packed-refs
>      drwxr-s---   4 root etckeeper   4096 Jun  5  2013 refs
> 
> Doesn't look dubious at all. Unless you are root you have to be in
> the etckeeper group to get read access, restricted by the top level
> directory and all underneath files and directories . Note the sticky
> bit for the etckeeper group. What is wrong with that?
> 
> Every insightful comment is highly appreciated.
> 
> 
> Regards
> Harri
> 
Previous: Harald Dunkel
Message 2 of 2 in “git-shell vs "detected dubious ownership in repository"”
  1. Harald DunkelMay 21, 2024
  2. Carlisle T. HamlinMay 27, 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.