cleanup: move fs helpers into escapingfs

This commit is contained in:
Seth Hoenig
2022-08-24 09:56:42 -05:00
parent 7f5dfe4478
commit 1b1a68e42f
9 changed files with 119 additions and 124 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/hashicorp/nomad/helper"
hargs "github.com/hashicorp/nomad/helper/args"
"github.com/hashicorp/nomad/helper/escapingfs"
"github.com/hashicorp/nomad/lib/cpuset"
"github.com/hashicorp/nomad/nomad/structs"
"github.com/hashicorp/nomad/plugins/drivers"
@@ -341,7 +342,7 @@ func (t *TaskEnv) replaceEnvClient(arg string) string {
// directory path fields of this TaskEnv
func (t *TaskEnv) checkEscape(testPath string) bool {
for _, p := range []string{t.clientTaskDir, t.clientSharedAllocDir} {
if p != "" && !helper.PathEscapesSandbox(p, testPath) {
if p != "" && !escapingfs.PathEscapesSandbox(p, testPath) {
return false
}
}