aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/shim/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/shim/main.go')
-rw-r--r--internal/shim/main.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/shim/main.go b/internal/shim/main.go
index f9cf0386..e5bca6fd 100644
--- a/internal/shim/main.go
+++ b/internal/shim/main.go
@@ -3,6 +3,7 @@ package shim
import (
"encoding/gob"
"errors"
+ "flag"
"fmt"
"net"
"os"
@@ -148,3 +149,13 @@ func receiveWLfd(conn *net.UnixConn) (int, error) {
return fds[0], nil
}
}
+
+// Try runs shim and stops execution if FORTIFY_SHIM is set.
+func Try() {
+ if args := flag.Args(); len(args) == 1 && args[0] == "shim" {
+ if s, ok := os.LookupEnv(EnvShim); ok {
+ shim(s)
+ panic("unreachable")
+ }
+ }
+}