shim: get rid of insane launch condition
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
parent
e4536b87ad
commit
b470941911
|
@ -57,8 +57,8 @@ func (a *app) commandBuilderMachineCtl(shimEnv string) (args []string) {
|
|||
}
|
||||
}
|
||||
|
||||
// both license and version flags need to be set to activate shim path
|
||||
innerCommand.WriteString("exec " + a.seal.sys.executable + " -V -license")
|
||||
// launch fortify as shim
|
||||
innerCommand.WriteString("exec " + a.seal.sys.executable + " shim")
|
||||
|
||||
// append inner command
|
||||
args = append(args, innerCommand.String())
|
||||
|
|
|
@ -26,7 +26,7 @@ func (a *app) commandBuilderSudo(shimEnv string) (args []string) {
|
|||
args = append(args, shimEnv)
|
||||
|
||||
// -- $@
|
||||
args = append(args, "--", a.seal.sys.executable, "-V", "--license") // magic for shim.Try()
|
||||
args = append(args, "--", a.seal.sys.executable, "shim")
|
||||
|
||||
return
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,11 +80,3 @@ func ServeConfig(socket string, payload *Payload, wl string, done chan struct{})
|
|||
return ws, nil
|
||||
}
|
||||
}
|
||||
|
||||
// Try runs shim and stops execution if FORTIFY_SHIM is set.
|
||||
func Try() {
|
||||
if s, ok := os.LookupEnv(EnvShim); ok {
|
||||
shim(s)
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue