aboutsummaryrefslogtreecommitdiffhomepage
path: root/helper
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-03-16 01:20:09 +0900
committerOphestra <cat@gensokyo.uk>2025-03-16 01:20:09 +0900
commit273d97af8502059193ccb6a188422f9d22eaf106 (patch)
treed26ae85bbdd32d15c8581627923c607a261370e3 /helper
parent891316d9240fc5cf451ad88f92e82f82b1751ab8 (diff)
ldd: lib paths resolve function
This is what always happens right after a ldd call, so implement it here. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'helper')
-rw-r--r--helper/stub.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/helper/stub.go b/helper/stub.go
index 988004c2..942f1501 100644
--- a/helper/stub.go
+++ b/helper/stub.go
@@ -6,7 +6,6 @@ import (
"io"
"os"
"path"
- "slices"
"strconv"
"strings"
"syscall"
@@ -147,17 +146,10 @@ func bwrapStub() {
sc.Chdir = "/"
sc.Syscall = &bwrap.SyscallPolicy{DenyDevel: true, Multiarch: true}
sc.AsInit = false
-
- bindTarget := []string{"/tmp/fortify.1971/12622d846cc3fe7b4c10359d01f0eb47"}
- slices.Sort(bindTarget)
- for _, name := range bindTarget {
- sc.Bind(name, name, false, true)
- }
- roBindTarget := []string{"/run/user/1971", path.Dir(os.Args[0])}
- slices.Sort(roBindTarget)
- for _, name := range roBindTarget {
- sc.Bind(name, name)
- }
+ sc.
+ Bind("/run/user/1971", "/run/user/1971").
+ Bind("/tmp/fortify.1971/12622d846cc3fe7b4c10359d01f0eb47", "/tmp/fortify.1971/12622d846cc3fe7b4c10359d01f0eb47", false, true).
+ Bind(path.Dir(os.Args[0]), path.Dir(os.Args[0]))
// manipulate extra files list so fd ends up as 5
efp.Append()