diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el index 65d5f27..67a517a 100644 --- a/lisp/tramp-sh.el +++ b/lisp/tramp-sh.el @@ -79,6 +79,9 @@ detected as prompt when being sent on echoing hosts, therefore.") (defconst tramp-initial-end-of-output "#$ " "Prompt when establishing a connection.") +(defconst tramp-end-of-heredoc (md5 tramp-end-of-output) + "String used to recognize end of heredoc strings.") + ;; Initialize `tramp-methods' with the supported methods. ;;;###tramp-autoload (add-to-list 'tramp-methods @@ -1443,8 +1446,11 @@ be non-negative integers." (if (and (stringp acl-string) (tramp-remote-acl-p v) (progn (tramp-send-command - v (format "setfacl --set-file=- %s <<'EOF'\n%s\nEOF\n" - (tramp-shell-quote-argument localname) acl-string)) + v (format "setfacl --set-file=- %s <<'%s'\n%s\n%s\n" + (tramp-shell-quote-argument localname) + tramp-end-of-heredoc + acl-string + tramp-end-of-heredoc)) (tramp-send-command-and-check v nil))) ;; Success. (progn @@ -2707,14 +2713,15 @@ the result will be a local, non-Tramp, filename." (when (stringp program) (format "cd %s; exec %s env PS1=%s %s" (tramp-shell-quote-argument localname) - (if heredoc "<