Commit 6f561220 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Merge branch 'fix/exec_with_ld_library_path' into 'master'

Pass LD_LIBRARY_PATH to the git command

As gitlab-shell does in https://gitlab.com/gitlab-org/gitlab-shell/blob/master/lib/gitlab_shell.rb#L126

LD_LIBRARY_PATH is needed when using Software Collections for instance but there are probably many other scenarios that need it as well. It was passed to git (and from git to hooks) by gitlab-shell, and still is for SSH access, but it was not the case anymore for HTTP access with the introduction of gitlab-git-http-server/git-workhorse.


See merge request !1
parents 2fed6af6 8be8617b
...@@ -30,6 +30,7 @@ func gitCommand(gl_id string, name string, args ...string) *exec.Cmd { ...@@ -30,6 +30,7 @@ func gitCommand(gl_id string, name string, args ...string) *exec.Cmd {
// Explicitly set the environment for the Git command // Explicitly set the environment for the Git command
cmd.Env = []string{ cmd.Env = []string{
fmt.Sprintf("PATH=%s", os.Getenv("PATH")), fmt.Sprintf("PATH=%s", os.Getenv("PATH")),
fmt.Sprintf("LD_LIBRARY_PATH=%s", os.Getenv("LD_LIBRARY_PATH")),
fmt.Sprintf("GL_ID=%s", gl_id), fmt.Sprintf("GL_ID=%s", gl_id),
} }
// If we don't do something with cmd.Stderr, Git errors will be lost // If we don't do something with cmd.Stderr, Git errors will be lost
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment