From eea4709354bf78571c09a1cf49b3c70182bd14f4 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 12 Dec 2020 15:54:46 -0500 Subject: [PATCH] cli: run post-script indirectly Fixes cases where /tmp is mounted with noexec. --- bin/doom | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/doom b/bin/doom index 867e3a36c..8dc0fcc84 100755 --- a/bin/doom +++ b/bin/doom @@ -3,7 +3,7 @@ :; case "$EMACS" in *term*) EMACS=emacs ;; *) EMACS="${EMACS:-emacs}" ;; esac :; $EMACS --version >/dev/null 2>&1 || { >&2 echo "Can't find emacs in your PATH"; exit 1; } :; $EMACS --no-site-file --script "$0" -- "$@" || __DOOMCODE=$? -:; [ "${__DOOMCODE:-0}" -eq 128 ] && { "`$EMACS -Q --batch --eval '(princ temporary-file-directory)'`/doom.sh" "$0" "$@" && true; __DOOMCODE=$?; } +:; [ "${__DOOMCODE:-0}" -eq 128 ] && { sh "`$EMACS -Q --batch --eval '(princ temporary-file-directory)'`/doom.sh" "$0" "$@" && true; __DOOMCODE=$?; } :; exit $__DOOMCODE ;; The garbage collector isn't as important during CLI ops. A higher threshold @@ -125,7 +125,7 @@ (shell-quote-argument (match-string 2 env))))) (format "PATH=\"%s%s$PATH\" \\\n" (concat doom-emacs-dir "bin/") path-separator) "_postscript $@\n")) - (set-file-modes script #o700)) + (set-file-modes script #o600)) ;; Error code 128 is special: it means run the post-script after this ;; session ends. 128)