forked from security/hakurei
internal/pkg: exec nil path check during cure
This results in os.ErrInvalid instead of a panic, which hopefully improves user experience. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -96,6 +96,18 @@ func TestExec(t *testing.T) {
|
||||
},
|
||||
}),
|
||||
), nil, pkg.Checksum{}, errors.Join(stub.UniqueError(0xcafe))},
|
||||
|
||||
{"invalid paths", pkg.NewExec(
|
||||
t.Context(),
|
||||
msg,
|
||||
0,
|
||||
check.MustAbs("/work"),
|
||||
[]string{"HAKUREI_TEST=1"},
|
||||
check.MustAbs("/opt/bin/testtool"),
|
||||
[]string{"testtool"},
|
||||
|
||||
pkg.ExecContainerPath{},
|
||||
), nil, pkg.Checksum{}, os.ErrInvalid},
|
||||
})
|
||||
|
||||
// check init failure passthrough
|
||||
|
||||
Reference in New Issue
Block a user