From e71ae3b8c5b4a8f103a078783fef2f56ee5450a2 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 25 Jul 2025 00:43:22 +0900 Subject: 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 --- ldd/exec.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'ldd/exec.go') 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) } -- cgit v1.3.1