From: martin f krafft Date: Wed, 04 Dec 2024 10:23:36 GMT Subject: git-daemon not consulting ~/.gitconfig Message-ID: Hello, I found that git-daemon stopped serving repositories managed by gitolite, i.e. by a different Unix user. Hence, no big surprise that I would get ``` git-daemon[3126249]: detected dubious ownership in repository at '/srv/git/repositories/madduck/pub/etc/ssh.git' To add an exception for this directory, call: git config --global --add safe.directory /srv/git/repositories/madduck/pub/etc/ssh.git ``` in the logs. However, adding the config to `~gitdaemon/.gitconfig` did not have the desired effect. Neither did adding it to `~root/.gitconfig` and only `/etc/gitconfig` works. So I checked `strace` and found that when invoked by `git-daemon`, Git doesn't even consult `~/.gitconfig`, and I think this may be a bug. Here is the relevant strace for an access to git-daemon that triggers the above error: ``` root@alan:~# strace -fp 3146653 -e file 2>&1 | grep config [pid 3154713] access("/etc/gitconfig", R_OK) = 0 [pid 3154713] openat(AT_FDCWD, "/etc/gitconfig", O_RDONLY) = 3 [pid 3154713] access("/etc/gitconfig", R_OK) = 0 [pid 3154713] openat(AT_FDCWD, "/etc/gitconfig", O_RDONLY) = 4 [pid 3154713] openat(AT_FDCWD, "./config", O_RDONLY) = 4 [pid 3154713] access("/etc/gitconfig", R_OK) = 0 [pid 3154713] openat(AT_FDCWD, "/etc/gitconfig", O_RDONLY) = 4 [pid 3154713] access("config", R_OK) = 0 [pid 3154713] openat(AT_FDCWD, "config", O_RDONLY) = 4 [pid 3154714] access("/etc/gitconfig", R_OK) = 0 [pid 3154714] openat(AT_FDCWD, "/etc/gitconfig", O_RDONLY) = 3 [pid 3154714] access("/etc/gitconfig", R_OK) = 0 [pid 3154714] openat(AT_FDCWD, "/etc/gitconfig", O_RDONLY) = 3 [pid 3154714] openat(AT_FDCWD, "./config", O_RDONLY) = 3 [pid 3154714] access("/etc/gitconfig", R_OK) = 0 [pid 3154714] openat(AT_FDCWD, "/etc/gitconfig", O_RDONLY) = 3 [pid 3154714] access("config", R_OK) = 0 [pid 3154714] openat(AT_FDCWD, "config", O_RDONLY) = 3 ``` [System Info] git version: git version 2.39.5 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 6.1.0-28-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.119-1 (2024-11-22) x86_64 compiler info: gnuc: 12.2 libc info: glibc: 2.36 $SHELL (typically, interactive shell): /bin/bash -- martin krafft | https://matrix.to/#/#madduck:madduck.net officer, arrest that man! he's whistling a copyrighted song. {: .blockquote } spamtraps: madduck.bogus@madduck.net {: .hidden }