Skip to content

Commit c7786d0

Browse files
K2GO-446 fix(terminal): set a writable TMPDIR for the host shell
Running the iiab script via mksh surfaced a latent failure: mksh spools here-docs to $TMPDIR, which is unset, so it fell back to a non-writable path and the login here-doc failed ("can't create temporary file ...: Permission denied"). Point TMPDIR at the app cache dir; the iiab function subshell inherits it. Device-confirmed: iiab --login enters Debian with no temp-file error.
1 parent d7a6f73 commit c7786d0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎controller/app/src/main/java/org/appdevforall/k2go/TerminalController.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,9 @@ public void addNewSession() {
992992
"TERM=xterm-256color",
993993
"HOME=" + workingDirectory.getAbsolutePath(),
994994
"ENV=" + mkshrcFile.getAbsolutePath(),
995+
// K2GO-446: writable TMPDIR so mksh can spool the iiab script's here-docs
996+
// (unset by default, mksh then falls back to a non-writable path).
997+
"TMPDIR=" + activity.getCacheDir().getAbsolutePath(),
995998
// Include the system bins and our W^X fake prefix bins
996999
"PATH=/sbin:/system/sbin:/system/bin:/system/xbin:" + workingDirectory.getAbsolutePath() + "/usr/bin"
9971000
};

0 commit comments

Comments
 (0)