Some Tramp fixes

* doc/misc/tramp.texi (GVFS-based methods): Ban sftp RemoteCommand
option.

* lisp/net/tramp-adb.el (tramp-adb-handle-copy-file)
(tramp-adb-handle-rename-file): Avoid calling jka-compr when
writing the target file.

* lisp/net/tramp-sh.el (tramp-sh-handle-file-ownership-preserved-p):
Skip GROUP test on *BSD machines.

* test/lisp/net/tramp-tests.el (tramp-test17-insert-directory-one-file):
Skip for tamp-crypt.el.
(tramp--test-sh-no-ls--dired-p): Ignore errors.
This commit is contained in:
Michael Albinus 2021-01-27 16:30:49 +01:00
parent 45112398cd
commit 12095de8b9
4 changed files with 22 additions and 3 deletions

View file

@ -1286,6 +1286,9 @@ This method uses @command{sftp} in order to securely access remote
hosts. @command{sftp} is a more secure option for connecting to hosts
that for security reasons refuse @command{ssh} connections.
When there is a respective entry in your @command{ssh} configuration,
do @emph{not} set the @option{RemoteCommand} option.
@end table
@defopt tramp-gvfs-methods

View file

@ -636,7 +636,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(copy-directory filename newname keep-date t)
(let ((t1 (tramp-tramp-file-p filename))
(t2 (tramp-tramp-file-p newname)))
(t2 (tramp-tramp-file-p newname))
;; We don't want the target file to be compressed, so we
;; let-bind `jka-compr-inhibit' to t.
(jka-compr-inhibit t))
(with-parsed-tramp-file-name (if t1 filename newname) nil
(unless (file-exists-p filename)
(tramp-error
@ -717,7 +720,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(delete-directory filename 'recursive))
(let ((t1 (tramp-tramp-file-p filename))
(t2 (tramp-tramp-file-p newname)))
(t2 (tramp-tramp-file-p newname))
;; We don't want the target file to be compressed, so we
;; let-bind `jka-compr-inhibit' to t.
(jka-compr-inhibit t))
(with-parsed-tramp-file-name (if t1 filename newname) nil
(unless (file-exists-p filename)
(tramp-error

View file

@ -1708,6 +1708,12 @@ ID-FORMAT valid values are `string' and `integer'."
(= (tramp-compat-file-attribute-user-id attributes)
(tramp-get-remote-uid v 'integer))
(or (not group)
;; 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-compat-file-attribute-group-id attributes)
(tramp-get-remote-gid v 'integer)))))))))

View file

@ -3192,6 +3192,8 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
(ert-deftest tramp-test17-insert-directory-one-file ()
"Check `insert-directory' inside directory listing."
(skip-unless (tramp--test-enabled))
;; Relative file names in dired are not supported in tramp-crypt.el.
(skip-unless (not (tramp--test-crypt-p)))
(dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
(let* ((tmp-name1
@ -5793,7 +5795,9 @@ Additionally, ls does not support \"--dired\"."
(and (tramp--test-sh-p)
(with-temp-buffer
;; We must refill the cache. `insert-directory' does it.
(insert-directory tramp-test-temporary-file-directory "-al")
;; This fails for tramp-crypt.el, so we ignore that.
(ignore-errors
(insert-directory tramp-test-temporary-file-directory "-al"))
(not (tramp-get-connection-property tramp-test-vec "ls--dired" nil)))))
(defun tramp--test-share-p ()