Skip to content

Commit bb103b2

Browse files
committed
fix(sandbox): deny zero credential directory
1 parent 538b31e commit bb103b2

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

internal/sandbox/manager_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ func TestCredentialDenyReadPathsForEnvironmentHonorsConfigOverrides(t *testing.T
458458
dockerConfigDir := filepath.Join(root, "docker")
459459
kubeConfigA := filepath.Join(root, "kube", "a")
460460
kubeConfigB := filepath.Join(root, "kube", "b")
461-
zeroConfig := filepath.Join(configHome, "zero", "config.json")
461+
zeroConfig := filepath.Join(configHome, "zero")
462462
filePaths := []string{
463463
npmrc,
464464
filepath.Join(ghConfigDir, "hosts.yml"),
@@ -475,6 +475,9 @@ func TestCredentialDenyReadPathsForEnvironmentHonorsConfigOverrides(t *testing.T
475475
if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
476476
t.Fatal(err)
477477
}
478+
if path == zeroConfig {
479+
continue
480+
}
478481
if err := os.WriteFile(path, []byte("{}"), 0o600); err != nil {
479482
t.Fatal(err)
480483
}

internal/sandbox/profile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func credentialDenyReadPathsForEnvironment(env credentialPathEnvironment, allowR
232232
}
233233
if configHome != "" {
234234
candidates = append(candidates,
235-
filepath.Join(configHome, "zero", "config.json"),
235+
filepath.Join(configHome, "zero"),
236236
)
237237
}
238238
cloudSDKConfig := strings.TrimSpace(env.CloudSDKConfig)

0 commit comments

Comments
 (0)