fix(agent): minimal env and explicit project dir for compose, resolve every config file's symlinks (#7)
This commit is contained in:
@@ -185,6 +185,11 @@ func TestComposeFiles(t *testing.T) {
|
||||
_, _, err := composeFiles([]string{root}, filepath.Join(root, "evil", "compose.yaml"))
|
||||
assert.EqualError(t, err, "stack directory "+filepath.Join(root, "evil")+" is not mounted into the agent at the same path (read-write)")
|
||||
})
|
||||
t.Run("second file under a symlink escaping the root", func(t *testing.T) {
|
||||
label := filepath.Join(a, "compose.yaml") + "," + filepath.Join(root, "evil", "extra.yaml")
|
||||
_, _, err := composeFiles([]string{root}, label)
|
||||
assert.ErrorContains(t, err, "not mounted")
|
||||
})
|
||||
t.Run("prefix trick", func(t *testing.T) {
|
||||
evil := root + "-evil"
|
||||
require.NoError(t, os.MkdirAll(evil, 0o755))
|
||||
|
||||
Reference in New Issue
Block a user