ldd: handle musl static behaviour
Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
29c3f8becb
commit
d22145a392
@ -14,6 +14,7 @@ import (
|
|||||||
const lddTimeout = 2 * time.Second
|
const lddTimeout = 2 * time.Second
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
msgStatic = []byte("Not a valid dynamic program")
|
||||||
msgStaticGlibc = []byte("not a dynamic executable")
|
msgStaticGlibc = []byte("not a dynamic executable")
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -46,7 +47,8 @@ func Exec(ctx context.Context, p string) ([]*Entry, error) {
|
|||||||
}
|
}
|
||||||
if err := h.Wait(); err != nil {
|
if err := h.Wait(); err != nil {
|
||||||
m := stderr.Bytes()
|
m := stderr.Bytes()
|
||||||
if bytes.Contains(m, msgStaticGlibc) {
|
if bytes.Contains(m, append([]byte(p+": "), msgStatic...)) ||
|
||||||
|
bytes.Contains(m, msgStaticGlibc) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user