summaryrefslogtreecommitdiff
path: root/internal/ctlsock/sanitize_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-01-29 15:24:47 +0100
committerJakob Unterwurzacher2017-01-29 15:24:47 +0100
commit532ef15417072cf6c6bd6576d78588f96800fa43 (patch)
treef9b2b01588baa173cbee723b01dd2456905f2756 /internal/ctlsock/sanitize_test.go
parent6166dad05c1bf505f1c0fca1fbe8bf6a27d02db9 (diff)
ctlsock: interpret paths that point above CWD as ""
Paths that start with ".." were previously accepted as-is.
Diffstat (limited to 'internal/ctlsock/sanitize_test.go')
-rw-r--r--internal/ctlsock/sanitize_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/ctlsock/sanitize_test.go b/internal/ctlsock/sanitize_test.go
index dfcb62c..bfdf0a7 100644
--- a/internal/ctlsock/sanitize_test.go
+++ b/internal/ctlsock/sanitize_test.go
@@ -15,6 +15,10 @@ func TestSanitizePath(t *testing.T) {
{"/foo/", "foo"},
{"/foo/./foo", "foo/foo"},
{"./", ""},
+ {"..", ""},
+ {"foo/../..", ""},
+ {"foo/../../aaaaaa", ""},
+ {"/foo/../../aaaaaa", ""},
}
for _, tc := range testCases {
res := SanitizePath(tc[0])