;; On BSD-derived systems files always inherit the
;; parent directory's group, so skip the group-gid
;; test.
- (string-match-p
- "BSD\\|DragonFly\\|Darwin"
- (tramp-get-connection-property v "uname" ""))
+ (tramp-check-remote-uname v "BSD\\|DragonFly\\|Darwin")
(= (tramp-compat-file-attribute-group-id attributes)
(tramp-get-remote-gid v 'integer)))))))))
(setq p (tramp-get-connection-process v))
(process-put p 'remote-pid pid)
(tramp-set-connection-property p "remote-pid" pid))
- ;; Disable carriage return to newline translation.
- (when (memq connection-type '(nil pipe))
+ ;; Disable carriage return to newline
+ ;; translation. This does not work on
+ ;; macOS, see Bug#50748.
+ (when (and (memq connection-type '(nil pipe))
+ (not (tramp-check-remote-uname v "Darwin")))
(tramp-send-command v "stty -icrnl"))
;; `tramp-maybe-open-connection' and
;; `tramp-send-command-and-read' could have
;; number of words it returns. "SunOS 5.10" (and maybe "SunOS
;; 5.11") have problems with this command, we disable the call
;; therefore.
- (unless (or ignore-path
- (string-match-p
- tramp-sunos-unames
- (tramp-get-connection-property vec "uname" "")))
+ (unless (or ignore-path (tramp-check-remote-uname vec tramp-sunos-unames))
(tramp-send-command vec (format "which \\%s | wc -w" progname))
(goto-char (point-min))
(if (looking-at-p "^\\s-*1$")
;; The default shell (ksh93) of OpenSolaris
;; and Solaris is buggy. We've got reports
;; for "SunOS 5.10" and "SunOS 5.11" so far.
- (string-match-p
- tramp-sunos-unames
- (tramp-get-connection-property vec "uname" "")))
+ (tramp-check-remote-uname vec tramp-sunos-unames))
(or (tramp-find-executable
vec "bash" (tramp-get-remote-path vec) t t)
;; Variables local to connection.
+(defun tramp-check-remote-uname (vec regexp)
+ "Check whether REGEXP matches the connection property \"uname\"."
+ (string-match-p regexp (tramp-get-connection-property vec "uname" "")))
+
(defun tramp-get-remote-path (vec)
"Compile list of remote directories for PATH.
Nonexistent directories are removed from spec."
(with-tramp-connection-property vec "stat"
;; stat on Solaris is buggy. We've got reports for "SunOS 5.10"
;; and "SunOS 5.11" so far.
- (unless (string-match-p
- tramp-sunos-unames (tramp-get-connection-property vec "uname" ""))
+ (unless (tramp-check-remote-uname vec tramp-sunos-unames)
(tramp-message vec 5 "Finding a suitable `stat' command")
(let ((result (tramp-find-executable
vec "stat" (tramp-get-remote-path vec)))
(require 'vc-git)
(require 'vc-hg)
+(declare-function tramp-check-remote-uname "tramp-sh")
(declare-function tramp-find-executable "tramp-sh")
(declare-function tramp-get-remote-chmod-h "tramp-sh")
(declare-function tramp-get-remote-gid "tramp-sh")
(while (< (- (point-max) (point-min))
(length "66\n6F\n6F\n0D\n0A\n"))
(while (accept-process-output proc 0 nil t))))
+ (if (tramp--test-macos-p)
+ (tramp--test-message
+ "process-connection-type %s\n%s"
+ process-connection-type (pp-to-string (buffer-string)))
(should
(string-match-p
(if (memq process-connection-type '(nil pipe))
;; flag is FALSE. See telnet(1) man page.
"66\n6F\n6F\n0D\\(\n00\\)?\n0A\n"
"66\n6F\n6F\n0A\\(\n00\\)?\n0A\n")
- (buffer-string))))
+ (buffer-string)))))
;; Cleanup.
(ignore-errors (delete-process proc)))))
(while (< (- (point-max) (point-min))
(length "66\n6F\n6F\n0D\n0A\n"))
(while (accept-process-output proc 0 nil t))))
+ (if (tramp--test-macos-p)
+ (tramp--test-message
+ "process-connection-type %s\n%s"
+ process-connection-type (pp-to-string (buffer-string)))
(should
(string-match-p
(if (memq (or connection-type process-connection-type)
;; flag is FALSE. See telnet(1) man page.
"66\n6F\n6F\n0D\\(\n00\\)?\n0A\n"
"66\n6F\n6F\n0A\\(\n00\\)?\n0A\n")
- (buffer-string))))
+ (buffer-string)))))
;; Cleanup.
(ignore-errors (delete-process proc)))))))))
Several special characters do not work properly there."
;; We must refill the cache. `file-truename' does it.
(file-truename tramp-test-temporary-file-directory)
- (string-match-p
- "^HP-UX" (tramp-get-connection-property tramp-test-vec "uname" "")))
+ (tramp-check-remote-uname tramp-test-vec "^HP-UX"))
(defun tramp--test-ksh-p ()
"Check, whether the remote shell is ksh.
(string-match-p
"ksh$" (tramp-get-connection-property tramp-test-vec "remote-shell" "")))
+(defun tramp--test-macos-p ()
+ "Check, whether the remote host runs macOS."
+ ;; We must refill the cache. `file-truename' does it.
+ (file-truename tramp-test-temporary-file-directory)
+ (tramp-check-remote-uname tramp-test-vec "Darwin"))
+
(defun tramp--test-mock-p ()
"Check, whether the mock method is used.
This does not support external Emacs calls."