mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(agent/agentcontext): canonicalize scan root in symlink boundary check (#26175)
This commit is contained in:
@@ -67,8 +67,8 @@ func TestManager_InitialSnapshotIsPopulated(t *testing.T) {
|
||||
|
||||
func TestManager_AddSourceTriggersResolve(t *testing.T) {
|
||||
t.Parallel()
|
||||
wd := t.TempDir()
|
||||
src := t.TempDir()
|
||||
wd := testutil.TempDirResolved(t)
|
||||
src := testutil.TempDirResolved(t)
|
||||
mustWriteFile(t, filepath.Join(src, "AGENTS.md"), "from source")
|
||||
|
||||
m := newTestManager(t, agentcontext.ManagerOptions{
|
||||
@@ -194,7 +194,7 @@ func TestManager_RemoveSource(t *testing.T) {
|
||||
func TestManager_HasSource(t *testing.T) {
|
||||
t.Parallel()
|
||||
wd := t.TempDir()
|
||||
src := t.TempDir()
|
||||
src := testutil.TempDirResolved(t)
|
||||
|
||||
m := newTestManager(t, agentcontext.ManagerOptions{
|
||||
WorkingDir: func() string { return wd },
|
||||
@@ -285,7 +285,7 @@ func TestManager_ResyncCanceledKeepsLiveSnapshot(t *testing.T) {
|
||||
func TestManager_InitialSourcesSeeded(t *testing.T) {
|
||||
t.Parallel()
|
||||
wd := t.TempDir()
|
||||
src := t.TempDir()
|
||||
src := testutil.TempDirResolved(t)
|
||||
mustWriteFile(t, filepath.Join(src, "AGENTS.md"), "from initial")
|
||||
|
||||
m := newTestManager(t, agentcontext.ManagerOptions{
|
||||
@@ -312,7 +312,7 @@ func TestManager_InitialSourcesSeeded(t *testing.T) {
|
||||
func TestManager_SeedSourcesLateBindsAfterManifest(t *testing.T) {
|
||||
t.Parallel()
|
||||
wd := t.TempDir()
|
||||
late := t.TempDir()
|
||||
late := testutil.TempDirResolved(t)
|
||||
mustWriteFile(t, filepath.Join(late, "AGENTS.md"), "late binding")
|
||||
|
||||
// AllowedRoots intentionally omits `late` so AddSource
|
||||
|
||||
Reference in New Issue
Block a user