This commit is contained in:
Steve Yegge
2025-11-22 16:49:54 -08:00

View File

@@ -3,6 +3,7 @@ package main
import ( import (
"os" "os"
"path/filepath" "path/filepath"
"runtime"
"testing" "testing"
) )
@@ -110,9 +111,12 @@ func TestCleanupMergeArtifacts_CommandInjectionPrevention(t *testing.T) {
// exec.Command safely handled the filename. // exec.Command safely handled the filename.
// Verify that sensitive paths are NOT affected // Verify that sensitive paths are NOT affected
// Note: /etc/passwd only exists on Unix systems, so skip this check on Windows
if runtime.GOOS != "windows" {
if _, err := os.Stat("/etc/passwd"); err != nil { if _, err := os.Stat("/etc/passwd"); err != nil {
t.Errorf("Command injection may have occurred - /etc/passwd missing") t.Errorf("Command injection may have occurred - /etc/passwd missing")
} }
}
}) })
} }
} }