From 53960d48c7ecb9422b3cece2372060e434cb073e Mon Sep 17 00:00:00 2001 From: Davor Kapsa Date: Thu, 10 Oct 2019 23:06:17 +0200 Subject: Remove unnecessary assignment to path --- runsc/cmd/gofer.go | 1 - 1 file changed, 1 deletion(-) (limited to 'runsc') diff --git a/runsc/cmd/gofer.go b/runsc/cmd/gofer.go index fbd579fb8..7dfe00399 100644 --- a/runsc/cmd/gofer.go +++ b/runsc/cmd/gofer.go @@ -423,7 +423,6 @@ func resolveSymlinksImpl(root, base, rel string, followCount uint) (string, erro path := filepath.Join(base, name) if !strings.HasPrefix(path, root) { // One cannot '..' their way out of root. - path = root continue } fi, err := os.Lstat(path) -- cgit v1.2.3 From fec0663bb7a8ca8273a8f51480e183ef207d0e2a Mon Sep 17 00:00:00 2001 From: Davor Kapsa Date: Fri, 11 Oct 2019 06:38:26 +0200 Subject: Set base to root --- runsc/cmd/gofer.go | 1 + 1 file changed, 1 insertion(+) (limited to 'runsc') diff --git a/runsc/cmd/gofer.go b/runsc/cmd/gofer.go index 7dfe00399..4c2fb80bf 100644 --- a/runsc/cmd/gofer.go +++ b/runsc/cmd/gofer.go @@ -423,6 +423,7 @@ func resolveSymlinksImpl(root, base, rel string, followCount uint) (string, erro path := filepath.Join(base, name) if !strings.HasPrefix(path, root) { // One cannot '..' their way out of root. + base = root continue } fi, err := os.Lstat(path) -- cgit v1.2.3