aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/app.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-02-19 21:05:48 +0900
committerOphestra <cat@gensokyo.uk>2025-02-19 21:12:11 +0900
commit3c80fd2b0f907af7b179e9e307304c0fa52994a0 (patch)
treef52e8ed67f94f4ff8c423cd1e8b06fef82918c93 /internal/app/app.go
parentef81828e0c1ce6277e0b124f6062eab564dfeceb (diff)
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 <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/app.go')
-rw-r--r--internal/app/app.go13
1 files changed, 2 insertions, 11 deletions
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)