diff --git a/internal/miro/record_session.go b/internal/miro/record_session.go index 0605b8f..b0a0e06 100644 --- a/internal/miro/record_session.go +++ b/internal/miro/record_session.go @@ -13,7 +13,6 @@ import ( const ( recordVisibleHome = "/home/test" - recordVisibleTmp = "/tmp" recordGitDate = "2024-01-01T00:00:00Z" ) diff --git a/internal/miro/record_shell.go b/internal/miro/record_shell.go index d0b21b4..f6c7637 100644 --- a/internal/miro/record_shell.go +++ b/internal/miro/record_shell.go @@ -60,11 +60,9 @@ func buildRecordShellScript() string { var body bytes.Buffer if err := recordShellTemplate.Execute(&body, struct { VisibleHome string - VisibleTmp string GitDate string }{ VisibleHome: shQuote(recordVisibleHome), - VisibleTmp: shQuote(recordVisibleTmp), GitDate: shQuote(recordGitDate), }); err != nil { panic(fmt.Sprintf("render record shell template: %v", err)) diff --git a/internal/miro/record_shell.sh.tmpl b/internal/miro/record_shell.sh.tmpl index e2cf0ab..d4ba002 100644 --- a/internal/miro/record_shell.sh.tmpl +++ b/internal/miro/record_shell.sh.tmpl @@ -19,7 +19,7 @@ exec bwrap \ --ro-bind / / \ --tmpfs /home \ --bind "$host_home" {{ .VisibleHome }} \ - --bind "$host_tmp" {{ .VisibleTmp }} \ + --bind "$host_tmp" '/tmp' \ --dev /dev \ --proc /proc \ --unshare-pid \ @@ -36,7 +36,7 @@ exec bwrap \ --setenv PATH "$path_env" \ --setenv PS1 '$ ' \ --setenv TERM 'xterm-256color' \ - --setenv TMPDIR {{ .VisibleTmp }} \ + --setenv TMPDIR '/tmp' \ --setenv TZ 'UTC' \ --chdir {{ .VisibleHome }} \ bash --noprofile --norc -i diff --git a/internal/miro/record_test.go b/internal/miro/record_test.go index 408173b..e837020 100644 --- a/internal/miro/record_test.go +++ b/internal/miro/record_test.go @@ -172,7 +172,7 @@ func TestBuildRecordShellScriptUsesExpectedCommands(t *testing.T) { "path_env=${MIRO_RECORD_PATH_ENV:?}", "HOME=\"$host_home\" GIT_CONFIG_NOSYSTEM=1 git config --global user.name 'Miro Test'", "--bind \"$host_home\" " + shQuote(recordVisibleHome), - "--bind \"$host_tmp\" " + shQuote(recordVisibleTmp), + "--bind \"$host_tmp\" '/tmp'", "--setenv HOME " + shQuote(recordVisibleHome), "--setenv PATH \"$path_env\"", "--setenv PS1 '$ '", @@ -234,7 +234,7 @@ func TestRunRecordSessionUsesSandboxedScriptCommand(t *testing.T) { "--ro-bind / /", "--tmpfs /home", "--setenv HOME " + shQuote(recordVisibleHome), - "--setenv TMPDIR " + shQuote(recordVisibleTmp), + "--setenv TMPDIR '/tmp'", "bash --noprofile --norc -i", } { if !strings.Contains(body, want) {