forked from rosa/hakurei
ldd: remove deprecated API
Closes #25. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
21
ldd/exec.go
21
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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user