1
0

feat: use artefact name as default build output filename

This commit is contained in:
dump_stack() 2023-10-18 01:23:57 +00:00
parent 4a8f119b5d
commit 6f53a3f386
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
2 changed files with 6 additions and 3 deletions

View File

@ -185,9 +185,9 @@ func (cmd *DebugCmd) Run(g *Globals) (err error) {
return
}
remoteFile = "/tmp/exploit"
remoteFile = "/tmp/" + strings.Replace(ka.Name, " ", "_", -1)
if ka.Type == config.KernelModule {
remoteFile = "/tmp/module.ko"
remoteFile += ".ko"
}
err = q.CopyFile("user", outFile, remoteFile)

5
pew.go
View File

@ -268,7 +268,10 @@ func build(flog zerolog.Logger, tmp string, ka config.Artifact,
ki distro.KernelInfo, dockerTimeout time.Duration) (
outdir, outpath, output string, err error) {
target := fmt.Sprintf("%d", rand.Int())
target := strings.Replace(ka.Name, " ", "_", -1)
if target == "" {
target = fmt.Sprintf("%d", rand.Int())
}
outdir = tmp + "/source"