-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git v2.35.2 safe.directory trouble #903
Comments
I found that sudo git config --system --add safe.directory /home/git/repositories/me/myrepo.git fixed the issue, but I'm not convinced that it's the best solution. |
If you have many repositories, I think it's the best way to run git list under the same user which is responsible for creating the git repositories. At least that's what I did, after git introduced this security feature. |
@dmolony that seems to be the best way to deal with this right now, if you are unable to run with the same user. |
You can switch off this feature with However if the executed git command gets the HOME environment variable (which is not the case on my debian, because /etc/apache2/envvars starts with unset HOME), it will use the .gitconfig file from there. My suggestion is to introduce a setting in config.yml which would be passed as HOME environment variable for git from php, or simply hardwire a "githome" folder which would be placed in the gitlist root. This githome folder would contain a .gitconfig file:
|
@goss85 Thanks! Your system-wide syntax worked (git config --global --add safe.directory '*' did not). Another (not ideal) work-around was chowning all files to www:www for gitlist and my REPOs. |
The new git v2.35.2 introduces a fix for CVE-2022-24765 (see e.g. here) which causes it to refuse working in mixed user scenarios.
My web server runs as
http
user, while my git repos are owned by the usergit
.Therefore, since the recent git upgrade gitlist only shows the following warning for every repository.
First I tried with the latest release of legacy gitlist, v1.1.1.
Then I tried the same with latest (251b8a8) nightly, i.e. gitlist 2.0, and I'm getting a similar error in the log.
I'm not sure what exactly is the problem, as just browsing the repo as user
http
works, e.g.Unfortunately, the command mentioned in the error message does not resolve the problem, neither when executed as
http
nor asgit
A
chown -R http:http /home/git/repositories
fixes the issue of course, but it interferes with normal git access. So for the moment, the only work-around, I found, isAny ideas for a proper fix?
The text was updated successfully, but these errors were encountered: