-
-
Notifications
You must be signed in to change notification settings - Fork 385
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
apache fork user: Error stat'ing config file '/root/.gitconfig' #339
Comments
Could you please provide an step-by-step procedure to reproduce the problem? I have never used |
I suspect this comes from starting up as root and switching to a user like Git itself (git-daemon in particular) has changed a couple of times on what they want to do here. |
Yes, thats it, apache itself starts as root and switch to different user (nobody:nogroup for example) how to reproduce:
start server:
open in browser server-hostname:9999 (in my case beruska.dev:9999) and check /tmp/pygit2/error_log for lines
|
debian dependencies: apache2-mpm-prefork, libapache2-mod-python |
Okey I was able to reproduce the problem with the given instructions. But this looks more like a libgit2 issue, right ? |
seems to me it is.. but I did not go through libgit2 api and my example is in python so I wrote it here.. |
Here a simple (Python) script to reproduce the problem without Apache:
Its output:
Now this should be rewritten to a C program, and then open a libgit2 issue. |
Here a C test program:
@kocian now you can open a libgit2 issue if you wish Though the solution may be to switch the user environment in mod_python somehow.. |
thanks for c code @jdavid |
@kocian While we figure out how much we're willing to forgive in the library directly, you can use the options/settings which just went into pygit2 master, and change the search paths in your application, e.g.
|
thank u very much. I did not have much time so I switched to dulwich and finished my task with that.. by the way going throw the repo history with dulwich is huge pain in.. |
The policy from the libgit2 side is to set the search paths if you're not going to be running as a normal user, which the main bindings all support now, including pygit2. Closing, as the upstream bugs have been closed with that resolution. |
running apache fork under the different user using mod_python
import pygit2
pygit2.Repository("path/to/repo.git")
ends up with exception "Error stat'ing config file '/root/.gitconfig'"
The text was updated successfully, but these errors were encountered: