summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2021-05-06 12:59:32 +0100
committerNick Thomas <nick@gitlab.com>2021-05-06 12:59:32 +0100
commitc541500de556a635eff6cc7db1847fdb91305fb7 (patch)
tree52d7046f1910ddf31b497556a416219b301cde8c
parent60821cbd5e4319b8de758f47005ade891518e0d2 (diff)
downloadgitlab-shell-c541500de556a635eff6cc7db1847fdb91305fb7.tar.gz
Stop changing directory to the filesystem root
This behaviour dates from when Gitaly RPCs were executed in Ruby by a Go subprocess. It's not needed for gitlab-shell now that it's in Go, and it's a very strange thing for gitlab-sshd. Best just to remove it. If we wanted to retain this behaviour, we could have an `os.Chdir` call in the gitlab-shell binary, but I just don't think it's needed. Changelog: fixed
-rw-r--r--internal/handler/exec.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/internal/handler/exec.go b/internal/handler/exec.go
index ac59dab..0b1c56b 100644
--- a/internal/handler/exec.go
+++ b/internal/handler/exec.go
@@ -3,7 +3,6 @@ package handler
import (
"context"
"fmt"
- "os"
"strconv"
"strings"
@@ -137,11 +136,6 @@ func getConn(gc *GitalyCommand) (*GitalyConn, error) {
)
}
- // Use a working directory that won't get removed or unmounted.
- if err := os.Chdir("/"); err != nil {
- return nil, err
- }
-
// Configure distributed tracing
serviceName := fmt.Sprintf("gitlab-shell-%v", gc.ServiceName)
closer := tracing.Initialize(