fix(agent/agentcontext): canonicalize scan root in symlink boundary check (#26175)

This commit is contained in:
Kyle Carberry
2026-06-09 19:21:55 -07:00
committed by GitHub
parent deb6eec68b
commit cc9f10fbf2
4 changed files with 18 additions and 8 deletions
+2 -1
View File
@@ -10,6 +10,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/coder/coder/v2/agent/agentcontext"
"github.com/coder/coder/v2/testutil"
)
// switchHomeEnv overrides the platform-specific environment
@@ -99,7 +100,7 @@ func TestValidateSourcePath_RejectsParentSegments(t *testing.T) {
func TestValidateSourcePath_AllowsInsideRoot(t *testing.T) {
t.Parallel()
dir := t.TempDir()
dir := testutil.TempDirResolved(t)
child := filepath.Join(dir, "child")
require.NoError(t, os.MkdirAll(child, 0o755))