From 584732f80ab91afb349720cfb8e9979ed2ba173e Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Sat, 2 Nov 2024 03:03:44 +0900 Subject: cmd: shim and init into separate binaries This change also fixes a deadlock when shim fails to connect and complete the setup. Signed-off-by: Ophestra Umiker --- internal/app/seal.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'internal/app/seal.go') diff --git a/internal/app/seal.go b/internal/app/seal.go index 80c3ec29..502ec6e2 100644 --- a/internal/app/seal.go +++ b/internal/app/seal.go @@ -7,10 +7,10 @@ import ( "path" "strconv" + shim "git.ophivana.moe/security/fortify/cmd/fshim/ipc" "git.ophivana.moe/security/fortify/dbus" - "git.ophivana.moe/security/fortify/internal" "git.ophivana.moe/security/fortify/internal/fmsg" - "git.ophivana.moe/security/fortify/internal/shim" + "git.ophivana.moe/security/fortify/internal/linux" "git.ophivana.moe/security/fortify/internal/state" "git.ophivana.moe/security/fortify/internal/system" ) @@ -66,7 +66,7 @@ type appSeal struct { // seal system-level component sys *appSealSys - internal.Paths + linux.Paths // protected by upstream mutex } @@ -127,13 +127,6 @@ func (a *app) Seal(config *Config) error { // create seal system component seal.sys = new(appSealSys) - // look up fortify executable path - if p, err := a.os.Executable(); err != nil { - return fmsg.WrapErrorSuffix(err, "cannot look up fortify executable path:") - } else { - seal.sys.executable = p - } - // look up user from system if u, err := a.os.Lookup(config.User); err != nil { if errors.As(err, new(user.UnknownUserError)) { -- cgit v1.3.1