ldd: implement strict ldd output parser

Fortify needs to internally resolve helper program sandbox config. They are considered trusted and runs under the privileged UID so ldd output is used to determine libraries they need inside the sandbox environment.

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
2024-10-09 20:39:27 +09:00
parent b99ed94386
commit 6232291cae
2 changed files with 95 additions and 0 deletions

11
ldd/error.go Normal file
View File

@@ -0,0 +1,11 @@
package ldd
import "fmt"
type EntryUnexpectedSegmentsError struct {
Entry string
}
func (e *EntryUnexpectedSegmentsError) Error() string {
return fmt.Sprintf("unexpected segments in entry %q", e.Entry)
}