From 3c80fd2b0f907af7b179e9e307304c0fa52994a0 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 19 Feb 2025 21:05:48 +0900 Subject: app: defer system.I revert Just returning an error after a successful call of commit will leave garbage behind with no way for the caller to clean them. This change ensures revert is always called after successful commit with at least per-process state enabled. Signed-off-by: Ophestra --- internal/app/app.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'internal/app/app.go') diff --git a/internal/app/app.go b/internal/app/app.go index 6696e189..be59a7d5 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -5,7 +5,6 @@ import ( "sync" "git.gensokyo.uk/security/fortify/fst" - "git.gensokyo.uk/security/fortify/internal/app/shim" "git.gensokyo.uk/security/fortify/internal/fmsg" "git.gensokyo.uk/security/fortify/internal/sys" ) @@ -22,15 +21,11 @@ func New(os sys.State) (fst.App, error) { } type app struct { - // application unique identifier - id *stringPair[fst.ID] - // operating system interface + id *stringPair[fst.ID] sys sys.State - // shim process manager - shim *shim.Shim - mu sync.RWMutex *appSeal + mu sync.RWMutex } func (a *app) ID() fst.ID { return a.id.unwrap() } @@ -43,10 +38,6 @@ func (a *app) String() string { a.mu.RLock() defer a.mu.RUnlock() - if a.shim != nil { - return a.shim.String() - } - if a.appSeal != nil { if a.appSeal.user.uid == nil { return fmt.Sprintf("(sealed app %s with invalid uid)", a.id) -- cgit v1.3.1