From 0cb1007daaea2b8f6b28bff72aa5d08aea981ea9 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 17 Mar 2026 13:53:14 +0900 Subject: ldd: remove deprecated API Closes #25. Signed-off-by: Ophestra --- ldd/exec.go | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'ldd/exec.go') diff --git a/ldd/exec.go b/ldd/exec.go index c0b40655..7392bd8b 100644 --- a/ldd/exec.go +++ b/ldd/exec.go @@ -18,14 +18,17 @@ import ( ) const ( - // msgStaticSuffix is the suffix of message printed to stderr by musl on a statically linked program. + // msgStaticSuffix is the suffix of message printed to stderr by musl on a + // statically linked program. msgStaticSuffix = ": Not a valid dynamic program" - // msgStaticGlibc is a substring of the message printed to stderr by glibc on a statically linked program. + // msgStaticGlibc is a substring of the message printed to stderr by glibc + // on a statically linked program. msgStaticGlibc = "not a dynamic executable" // lddName is the file name of ldd(1) passed to exec.LookPath. lddName = "ldd" - // lddTimeout is the maximum duration ldd(1) is allowed to ran for before it is terminated. + // lddTimeout is the maximum duration ldd(1) is allowed to ran for before it + // is terminated. lddTimeout = 4 * time.Second ) @@ -104,15 +107,3 @@ func Resolve( } return entries, decodeErr } - -// Exec runs ldd(1) in a restrictive [container] and connects it to a [Decoder], returning resulting entries. -// -// Deprecated: this function takes an unchecked pathname string. -// Relative pathnames do not work in the container as working directory information is not sent. -func Exec(ctx context.Context, msg message.Msg, pathname string) ([]*Entry, error) { - if a, err := check.NewAbs(pathname); err != nil { - return nil, err - } else { - return Resolve(ctx, msg, a) - } -} -- cgit v1.3.1