forked from security/hakurei
internal/outcome/shim: EOF as exit request fallback
In some cases the signal might be delivered before the signal handler is installed, and synchronising against such a case is too expensive. Instead, use the pipe being closed as a fallback to the regular exit request. This change also moves installation of the signal handler early. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -331,9 +331,10 @@ func (k *kstub) new(f func(k syscallDispatcher, msg message.Msg)) {
|
||||
k.New(func(k syscallDispatcher) { f(k, k.(*kstub)) })
|
||||
}
|
||||
|
||||
func (k *kstub) getpid() int { k.Helper(); return k.Expects("getpid").Ret.(int) }
|
||||
func (k *kstub) getuid() int { k.Helper(); return k.Expects("getuid").Ret.(int) }
|
||||
func (k *kstub) getgid() int { k.Helper(); return k.Expects("getgid").Ret.(int) }
|
||||
func (k *kstub) getppid() int { k.Helper(); return k.Expects("getppid").Ret.(int) }
|
||||
func (k *kstub) getpid() int { k.Helper(); return k.Expects("getpid").Ret.(int) }
|
||||
func (k *kstub) getuid() int { k.Helper(); return k.Expects("getuid").Ret.(int) }
|
||||
func (k *kstub) getgid() int { k.Helper(); return k.Expects("getgid").Ret.(int) }
|
||||
func (k *kstub) lookupEnv(key string) (string, bool) {
|
||||
k.Helper()
|
||||
expect := k.Expects("lookupEnv")
|
||||
|
||||
Reference in New Issue
Block a user