#1081758 Git latest version for bookhorn 12.7 broke git-daemon

Package:
git
Source:
git
Description:
fast, scalable, distributed revision control system
Submitter:
Mauro Carvalho Chehab
Date:
2024-09-16 08:24:01 UTC
Severity:
normal
#1081758#5
Date:
2024-09-14 15:06:09 UTC
From:
To:
A server running git-daemon received today an update to git 1:2.39.5.
After such update, git-daemon stopped working with those messages:

2024-09-14T12:01:00.585402+00:00 my_host git-daemon[4897]: #011git config --global --add safe.directory .
2024-09-14T12:01:00.585903+00:00 my_host git-daemon[4472]: [4897] Disconnected (with error)
2024-09-14T12:02:00.551603+00:00 my_host git-daemon[5037]: Connection from xxx.xxx.xxx.xxx:41086
2024-09-14T12:02:00.553966+00:00 my_host git-daemon[5037]: Extended attribute "host": my_host.org
2024-09-14T12:02:00.554099+00:00 my_host git-daemon[5037]: Extended attribute "protocol": version=2
2024-09-14T12:02:00.554146+00:00 my_host git-daemon[5037]: Request upload-pack for '/edid-decode.git'
2024-09-14T12:02:00.554384+00:00 my_host git-daemon[5037]: detected dubious ownership in repository at '/git/my-repository.git'#012To add an exception for this directory, call:#012#012#011git config --global --add safe.directory /git/my-repository.git
2024-09-14T12:02:00.554622+00:00 my_host git-daemon[4472]: [5037] Disconnected (with error)

The problem happens with both shared and not shared repositories and adding
safe.directory to /etc/gitconfig doesn't solve.

After reverting to 1:2.39.2-1.1, git-daemon worked fine.

Thanks,
Mauro

#1081758#10
Date:
2024-09-14 18:49:38 UTC
From:
To:
It seems to be related to #1076750, and I found a possible
workaround in https://bugs.gentoo.org/932091 is to add
some environment variables to the git-daemon startup script
to disable the owner checks in git-daemon only.

  GIT_CONFIG_COUNT=1
  GIT_CONFIG_KEY_0=safe.directory
  GIT_CONFIG_VALUE_0="*"

See especially https://bugs.gentoo.org/932091#c2


Thanks,
Johannes

#1081758#15
Date:
2024-09-16 08:19:28 UTC
From:
To:
I tried the workaround but it doesn't work. I put
this in /etc/default/git-daemon:

export GIT_CONFIG_COUNT=1
export GIT_CONFIG_KEY_0=safe.directory
export GIT_CONFIG_VALUE_0="*"

Then reinstalled 2.39.5-0+deb12u1 and confirmed with htop
the environment variables are set for git-daemon.

But "git clone" fails:

  fatal: unable to access '...': The requested URL returned error: 500


Johannes