-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Explicitly disable Git credential helper #5367
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5367 +/- ##
==========================================
- Coverage 37.57% 37.57% -0.01%
==========================================
Files 313 313
Lines 46617 46611 -6
==========================================
- Hits 17515 17512 -3
+ Misses 26607 26605 -2
+ Partials 2495 2494 -1
Continue to review full report at Codecov.
|
Tests seem to be failing after this changes |
I am not sure why this is happening. With my initial PR, the tests ran fine but after rebasing, test-{sqlite,mysql,pgsql} keep failing randomly (sometimes they pass, sometimes they do not). Moreover, the most recent failure in test-pgsql shows this:
but |
Sorry for the force-push spam, I had to play around a bit since I cannot reproduce the problem locally. I still have not been able to fix it, so any help is welcome. |
CI failed. |
Seems I finally managed to fix the problem: It is a bug in the git module, which I have reported here: go-gitea/git#135 |
@michaelkuhn thank you for taking the time to trace this problem. It is much appreciated 😄 |
If the user running Gitea has configured a credential helper, Git credentials might leak out of Gitea. There are two problems with credential helpers when combined with Gitea: 1. Credentials entered by a user when doing a migration or setting up a mirror will end up in the credential store. In the worst case, this is the plain text file ~/.git-credentials. 2. Credentials in the credential store will be used for migrations and mirrors by all users. For example, if user A sets up a mirror, their credentials will be stored. If user B later sets up a mirror from the same host and does not enter any credentials, user A's credentials will be used. This PR prepends -c credential.helper= to all Git commands to clear the list of helpers. This requires at least Git version 2.9, as previous versions will try to load an empty helper instead. For more details, see git/git@2432137
Now that go-gitea/git#135 has been merged (thanks!), I have rebased the PR to current master and included a commit to update the git module. |
Great, thanks :) |
If the user running Gitea has configured a credential helper, Git credentials might leak out of Gitea.
There are two problems with credential helpers when combined with Gitea:
This PR prepends -c credential.helper= to all Git commands to clear the list of helpers. This requires at least Git version 2.9, as previous versions will try to load an empty helper instead. For more details, see git/git@2432137
(Related to #3966)