aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/fsu/main.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-01-17 23:43:32 +0900
committerOphestra <cat@gensokyo.uk>2025-01-17 23:43:32 +0900
commitea8f228af36b2c9ae9918f7760c3af4f1e21cfa2 (patch)
tree1f9b43cd1a0f83217f20e76924b8ae48e182cf0c /cmd/fsu/main.go
parent16db3dabe2060d5a66948101e16709697bfb374a (diff)
proc/priv/shim: merge shim into main program
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/fsu/main.go')
-rw-r--r--cmd/fsu/main.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/cmd/fsu/main.go b/cmd/fsu/main.go
index 2412a0e6..1f90a390 100644
--- a/cmd/fsu/main.go
+++ b/cmd/fsu/main.go
@@ -24,7 +24,6 @@ const (
var (
Fmain = compPoison
- Fshim = compPoison
)
func main() {
@@ -41,17 +40,12 @@ func main() {
log.Fatal("this program must not be started by root")
}
- var fmain, fshim string
+ var fmain string
if p, ok := checkPath(Fmain); !ok {
log.Fatal("invalid fortify path, this copy of fsu is not compiled correctly")
} else {
fmain = p
}
- if p, ok := checkPath(Fshim); !ok {
- log.Fatal("invalid fshim path, this copy of fsu is not compiled correctly")
- } else {
- fshim = p
- }
pexe := path.Join("/proc", strconv.Itoa(os.Getppid()), "exe")
if p, err := os.Readlink(pexe); err != nil {
@@ -142,7 +136,7 @@ func main() {
if _, _, errno := syscall.AllThreadsSyscall(syscall.SYS_PRCTL, PR_SET_NO_NEW_PRIVS, 1, 0); errno != 0 {
log.Fatalf("cannot set no_new_privs flag: %s", errno.Error())
}
- if err := syscall.Exec(fshim, []string{"fshim"}, []string{envShim + "=" + shimSetupFd}); err != nil {
+ if err := syscall.Exec(fmain, []string{"fortify", "shim"}, []string{envShim + "=" + shimSetupFd}); err != nil {
log.Fatalf("cannot start shim: %v", err)
}