aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/app.go
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-10-27 00:46:15 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-10-27 00:46:15 +0900
commit1d6ea8120552665072f5044a004128e7dbbf3a64 (patch)
tree1ea0b9d2f687909cdd5fab3fbf50c473f942e7cf /internal/app/app.go
parentae1a102882103221ef842176dfd8cb1090d5f591 (diff)
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 <cat@ophivana.moe>
Diffstat (limited to 'internal/app/app.go')
-rw-r--r--internal/app/app.go12
1 files changed, 5 insertions, 7 deletions
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 {