From be60d4b14a74f53c03be0cf9f0a5eb9a73a73495 Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Thu, 16 May 2024 13:21:46 -0700 Subject: [PATCH] cpu: set TMPDIR environment variable to /tmp Set the TMPDIR environment variable to /tmp, always. Signed-off-by: Ronald G. Minnich --- cmds/cpu/cpu.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmds/cpu/cpu.go b/cmds/cpu/cpu.go index a001027e..3181ad4c 100644 --- a/cmds/cpu/cpu.go +++ b/cmds/cpu/cpu.go @@ -261,6 +261,12 @@ func main() { } } verbose("Running as client, to host %q, args %q", host, a) + // The remote system, for now, is always Linux or a standard Unix (or Plan 9) + // It will never be darwin (go argue with Apple) + // so /tmp is *always* /tmp + if err := os.Setenv("TMPDIR", "/tmp"); err != nil { + log.Printf("Warning: could not set TMPDIR: %v", err) + } *keyFile = getKeyFile(host, *keyFile) *port = getPort(host, *port)