aboutsummaryrefslogtreecommitdiffhomepage
path: root/ldd/exec.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-07-25 00:43:22 +0900
committerOphestra <cat@gensokyo.uk>2025-07-25 00:45:10 +0900
commite71ae3b8c5b4a8f103a078783fef2f56ee5450a2 (patch)
treee6b7a87006563da8c360ca248e261a7fe7e2820f /ldd/exec.go
parent9d7a19d162e7003ce89804f00c526b77b2328baa (diff)
container: remove custom cmd initialisation
This part of the interface is very unintuitive and only used for testing, even in testing it is inelegant and can be done better. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'ldd/exec.go')
-rw-r--r--ldd/exec.go12
1 files changed, 1 insertions, 11 deletions
diff --git a/ldd/exec.go b/ldd/exec.go
index 2544050e..c1593680 100644
--- a/ldd/exec.go
+++ b/ldd/exec.go
@@ -5,7 +5,6 @@ import (
"context"
"io"
"os"
- "os/exec"
"time"
"hakurei.app/container"
@@ -19,16 +18,10 @@ var (
msgStaticGlibc = []byte("not a dynamic executable")
)
-func Exec(ctx context.Context, p string) ([]*Entry, error) { return ExecFilter(ctx, nil, nil, p) }
-
-func ExecFilter(ctx context.Context,
- commandContext func(context.Context) *exec.Cmd,
- f func([]byte) []byte,
- p string) ([]*Entry, error) {
+func Exec(ctx context.Context, p string) ([]*Entry, error) {
c, cancel := context.WithTimeout(ctx, lddTimeout)
defer cancel()
z := container.New(c, "ldd", p)
- z.CommandContext = commandContext
z.Hostname = "hakurei-ldd"
z.SeccompFlags |= seccomp.AllowMultiarch
z.SeccompPresets |= seccomp.PresetStrict
@@ -54,8 +47,5 @@ func ExecFilter(ctx context.Context,
}
v := stdout.Bytes()
- if f != nil {
- v = f(v)
- }
return Parse(v)
}