From 1d6ea8120552665072f5044a004128e7dbbf3a64 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Sun, 27 Oct 2024 00:46:15 +0900 Subject: shim: user switcher process management struct This change moves all user switcher and shim management to the shim package and withholds output while shim is alive. This also eliminated all exit scenarios where revert is skipped. Signed-off-by: Ophestra Umiker --- internal/app/app.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'internal/app/app.go') diff --git a/internal/app/app.go b/internal/app/app.go index de2c461f..264975c5 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -1,10 +1,10 @@ package app import ( - "os/exec" "sync" "git.ophivana.moe/security/fortify/internal" + "git.ophivana.moe/security/fortify/internal/shim" ) type App interface { @@ -26,10 +26,8 @@ type app struct { id *ID // operating system interface os internal.System - // underlying user switcher process - cmd *exec.Cmd - // shim setup abort reason and completion - abort chan error + // shim process manager + shim *shim.Shim // child process related information seal *appSeal // error returned waiting for process @@ -50,8 +48,8 @@ func (a *app) String() string { a.lock.RLock() defer a.lock.RUnlock() - if a.cmd != nil { - return a.cmd.String() + if a.shim != nil { + return a.shim.String() } if a.seal != nil { -- cgit v1.3.1