Merge branch 'main' of https://github.com/steveyegge/beads
This commit is contained in:
@@ -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")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user