{"thread":{"id":"61523","subject":"git-shell vs \"detected dubious ownership in repository\"","startedAt":"2024-05-21T08:46:56Z","lastAt":"2024-05-27T21:35:55Z","messageCount":2,"participants":["Harald Dunkel","Carlisle T. Hamlin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"495154","messageId":"14ed85d8-dccb-4928-a4b8-a099d151fe5b@aixigo.com","threadId":"61523","inReplyTo":null,"subject":"git-shell vs \"detected dubious ownership in repository\"","fromName":"Harald Dunkel","fromEmail":"harald.dunkel@aixigo.com","sentAt":"2024-05-21T08:40:14Z","receivedAt":"2024-05-21T08:46:56Z","isPatch":false,"sender":{"key":"harald.dunkel@aixigo.com","avatar":null},"body":"Hi folks,\n\nsince 2.45.1 (upgraded from 2.40.something) I cannot pull my\netckeeper repositories anymore:\n\n\t# su - etckeeper\n\t% cd /archive/host.example.com\n\t% git remote -v\n\torigin  host.example.com:/etc (fetch)\n\torigin  host.example.com:/etc (push)\n\t% git pull\n\tfatal: detected dubious ownership in repository at '/etc/.git'\n\tTo add an exception for this directory, call:\n\t\n\t        git config --global --add safe.directory /etc/.git\n\tfatal: Could not read from remote repository.\n\t\n\tPlease make sure you have the correct access rights\n\tand the repository exists.\n\nPlease note there is git-shell on the remote side. Question is,\nwhat is dubious about the existing access bits of the remote repo?\nCurrently I have\n\n\troot@host.example.com:/etc/.git# ls -al\n\ttotal 532\n\tdrwxr-s---   8 root etckeeper   4096 May 21 10:14 .\n\tdrwxr-xr-x 242 root root       20480 May 18 06:28 ..\n\t-rw-r-s---   1 root etckeeper   2716 May 17 14:04 COMMIT_EDITMSG\n\t-rw-r-s---   1 root etckeeper     23 Jun  5  2013 HEAD\n\tdrwxr-s---   2 root etckeeper   4096 Jun  5  2013 branches\n\t-rw-r-s---   1 root etckeeper     92 Jun  5  2013 config\n\t-rw-r-s---   1 root etckeeper     37 Jun  5  2013 description\n\t-rw-r-s---   1 root etckeeper  70979 Jun 28  2021 gitk.cache\n\tdrwxr-s---   2 root etckeeper   4096 Jun  5  2013 hooks\n\t-rw-r-----   1 root etckeeper 397408 May 21 10:14 index\n\tdrwxr-s---   2 root etckeeper   4096 Jul 11  2023 info\n\tdrwxr-s---   3 root etckeeper   4096 Jul 11  2023 logs\n\tdrwxr-s--- 260 root etckeeper   4096 May 17 14:04 objects\n\t-rw-r-s---   1 root etckeeper    105 Jul 11  2023 packed-refs\n\tdrwxr-s---   4 root etckeeper   4096 Jun  5  2013 refs\n\nDoesn't look dubious at all. Unless you are root you have to be in\nthe etckeeper group to get read access, restricted by the top level\ndirectory and all underneath files and directories . Note the sticky\nbit for the etckeeper group. What is wrong with that?\n\nEvery insightful comment is highly appreciated.\n\n\nRegards\nHarri\n"},{"id":"495710","messageId":"d3983115-bcf5-4ed2-b47a-56af297b6a9c@gmx.com","threadId":"61523","inReplyTo":"14ed85d8-dccb-4928-a4b8-a099d151fe5b@aixigo.com","subject":"Re: git-shell vs \"detected dubious ownership in repository\"","fromName":"Carlisle T. Hamlin","fromEmail":"hamlin.carlisle@gmx.com","sentAt":"2024-05-27T21:35:50Z","receivedAt":"2024-05-27T21:35:55Z","isPatch":false,"sender":{"key":"hamlin.carlisle@gmx.com","avatar":"https://gravatar.com/avatar/1b441f4fa2cb6c0ef10fd46f270645762e5250c1ba993e6cd4aa54bcaaf1da5c?d=mp&s=160"},"body":"Hiya, Harald.\n\nI'm not sure if this is intended behaviour, but I've always ever had \nthat problem running my own servers when the group does not have write \naccess to the directory containing the repository.\n\nYou might, as a troubleshooting step, try giving the group write access \nand see if that makes the problem go away.\n\nAlternatively, you could also just add the directory as an exception \nusing the command provided.\n\nOn 5/21/24 01:40, Harald Dunkel wrote:\n> Hi folks,\n> \n> since 2.45.1 (upgraded from 2.40.something) I cannot pull my\n> etckeeper repositories anymore:\n> \n>      # su - etckeeper\n>      % cd /archive/host.example.com\n>      % git remote -v\n>      origin  host.example.com:/etc (fetch)\n>      origin  host.example.com:/etc (push)\n>      % git pull\n>      fatal: detected dubious ownership in repository at '/etc/.git'\n>      To add an exception for this directory, call:\n> \n>              git config --global --add safe.directory /etc/.git\n>      fatal: Could not read from remote repository.\n> \n>      Please make sure you have the correct access rights\n>      and the repository exists.\n> \n> Please note there is git-shell on the remote side. Question is,\n> what is dubious about the existing access bits of the remote repo?\n> Currently I have\n> \n>      root@host.example.com:/etc/.git# ls -al\n>      total 532\n>      drwxr-s---   8 root etckeeper   4096 May 21 10:14 .\n>      drwxr-xr-x 242 root root       20480 May 18 06:28 ..\n>      -rw-r-s---   1 root etckeeper   2716 May 17 14:04 COMMIT_EDITMSG\n>      -rw-r-s---   1 root etckeeper     23 Jun  5  2013 HEAD\n>      drwxr-s---   2 root etckeeper   4096 Jun  5  2013 branches\n>      -rw-r-s---   1 root etckeeper     92 Jun  5  2013 config\n>      -rw-r-s---   1 root etckeeper     37 Jun  5  2013 description\n>      -rw-r-s---   1 root etckeeper  70979 Jun 28  2021 gitk.cache\n>      drwxr-s---   2 root etckeeper   4096 Jun  5  2013 hooks\n>      -rw-r-----   1 root etckeeper 397408 May 21 10:14 index\n>      drwxr-s---   2 root etckeeper   4096 Jul 11  2023 info\n>      drwxr-s---   3 root etckeeper   4096 Jul 11  2023 logs\n>      drwxr-s--- 260 root etckeeper   4096 May 17 14:04 objects\n>      -rw-r-s---   1 root etckeeper    105 Jul 11  2023 packed-refs\n>      drwxr-s---   4 root etckeeper   4096 Jun  5  2013 refs\n> \n> Doesn't look dubious at all. Unless you are root you have to be in\n> the etckeeper group to get read access, restricted by the top level\n> directory and all underneath files and directories . Note the sticky\n> bit for the etckeeper group. What is wrong with that?\n> \n> Every insightful comment is highly appreciated.\n> \n> \n> Regards\n> Harri\n> \n\n"}]}