From 6bc5be7e5a2334274adf2945ad6d29d063a7086b Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Wed, 23 Oct 2024 21:46:21 +0900 Subject: internal: wrap calls to os standard library functions This change helps tests stub out and simulate OS behaviour during the sealing process. This also removes dependency on XDG_RUNTIME_DIR as the internal.System implementation provided to App provides a compat directory inside the tmpdir-based share when XDG_RUNTIME_DIR is unavailable. Signed-off-by: Ophestra Umiker --- internal/app/share.system.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/app/share.system.go') diff --git a/internal/app/share.system.go b/internal/app/share.system.go index b8c5f063..600119ee 100644 --- a/internal/app/share.system.go +++ b/internal/app/share.system.go @@ -1,10 +1,10 @@ package app import ( - "os" "path" "git.ophivana.moe/security/fortify/acl" + "git.ophivana.moe/security/fortify/internal" "git.ophivana.moe/security/fortify/internal/system" ) @@ -38,7 +38,7 @@ func (seal *appSeal) shareSystem() { seal.sys.bwrap.Tmpfs(seal.SharePath, 1*1024*1024) } -func (seal *appSeal) sharePasswd() { +func (seal *appSeal) sharePasswd(os internal.System) { // look up shell sh := "/bin/sh" if s, ok := os.LookupEnv(shell); ok { -- cgit v1.3.1