diff options
| author | Michael Albinus | 2019-01-23 15:23:57 +0100 |
|---|---|---|
| committer | Michael Albinus | 2019-01-23 15:23:57 +0100 |
| commit | 927d9f12173aab413868bd8d5abd42887b000e4e (patch) | |
| tree | de7163e8f56eca7464ee881379b6ab4b7cf6bb54 | |
| parent | 741c02d59407a9da2a1b28a69abe83b70f37b914 (diff) | |
| download | emacs-927d9f12173aab413868bd8d5abd42887b000e4e.tar.gz emacs-927d9f12173aab413868bd8d5abd42887b000e4e.zip | |
* lisp/net/tramp.el (tramp-set-file-uid-gid): Fix thinko.
* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case):
Adapt docstring.
| -rw-r--r-- | lisp/net/tramp.el | 8 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 27 |
2 files changed, 18 insertions, 17 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 6428e18331b..3c7770af877 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -4355,9 +4355,11 @@ depending whether FILENAME is remote or local. Both parameters | |||
| 4355 | must be non-negative integers. | 4355 | must be non-negative integers. |
| 4356 | The setgid bit of the upper directory is respected. | 4356 | The setgid bit of the upper directory is respected. |
| 4357 | If FILENAME is remote, a file name handler is called." | 4357 | If FILENAME is remote, a file name handler is called." |
| 4358 | (unless (zerop (logand #o2000 (file-modes (file-name-directory filename)))) | 4358 | (let* ((dir (file-name-directory filename)) |
| 4359 | (setq gid (tramp-compat-file-attribute-group-id | 4359 | (modes (file-modes dir))) |
| 4360 | (file-attributes (file-name-directory filename) 'integer)))) | 4360 | (when (and modes (not (zerop (logand modes #o2000)))) |
| 4361 | (setq gid (tramp-compat-file-attribute-group-id (file-attributes dir))))) | ||
| 4362 | |||
| 4361 | (let ((handler (find-file-name-handler filename 'tramp-set-file-uid-gid))) | 4363 | (let ((handler (find-file-name-handler filename 'tramp-set-file-uid-gid))) |
| 4362 | (if handler | 4364 | (if handler |
| 4363 | (funcall handler 'tramp-set-file-uid-gid filename uid gid) | 4365 | (funcall handler 'tramp-set-file-uid-gid filename uid gid) |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 9deb794f401..58860c7161a 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -161,9 +161,9 @@ This shall used dynamically bound only.") | |||
| 161 | 161 | ||
| 162 | (defmacro tramp--test-instrument-test-case (verbose &rest body) | 162 | (defmacro tramp--test-instrument-test-case (verbose &rest body) |
| 163 | "Run BODY with `tramp-verbose' equal VERBOSE. | 163 | "Run BODY with `tramp-verbose' equal VERBOSE. |
| 164 | Print the content of the Tramp debug buffer, if BODY does not | 164 | Print the content of the Tramp connection and debug buffers, if |
| 165 | eval properly in `should' or `should-not'. `should-error' is not | 165 | `tramp-verbose' is greater than 3. `should-error' is not handled |
| 166 | handled properly. BODY shall not contain a timeout." | 166 | properly. BODY shall not contain a timeout." |
| 167 | (declare (indent 1) (debug (natnump body))) | 167 | (declare (indent 1) (debug (natnump body))) |
| 168 | `(let ((tramp-verbose (max (or ,verbose 0) (or tramp-verbose 0))) | 168 | `(let ((tramp-verbose (max (or ,verbose 0) (or tramp-verbose 0))) |
| 169 | (tramp-message-show-message t) | 169 | (tramp-message-show-message t) |
| @@ -2251,7 +2251,6 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 2251 | "Check `copy-file'." | 2251 | "Check `copy-file'." |
| 2252 | (skip-unless (tramp--test-enabled)) | 2252 | (skip-unless (tramp--test-enabled)) |
| 2253 | 2253 | ||
| 2254 | (tramp--test-instrument-test-case (if (getenv "EMACS_EMBA_CI") 10 0) | ||
| 2255 | ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579. | 2254 | ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579. |
| 2256 | (dolist (quoted (if (and (tramp--test-expensive-test) (tramp--test-emacs27-p)) | 2255 | (dolist (quoted (if (and (tramp--test-expensive-test) (tramp--test-emacs27-p)) |
| 2257 | '(nil t) '(nil))) | 2256 | '(nil t) '(nil))) |
| @@ -2278,10 +2277,10 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 2278 | (with-temp-buffer | 2277 | (with-temp-buffer |
| 2279 | (insert-file-contents target) | 2278 | (insert-file-contents target) |
| 2280 | (should (string-equal (buffer-string) "foo"))) | 2279 | (should (string-equal (buffer-string) "foo"))) |
| 2281 | ;; (when (tramp--test-expensive-test) | 2280 | (when (tramp--test-expensive-test) |
| 2282 | ;; (should-error | 2281 | (should-error |
| 2283 | ;; (copy-file source target) | 2282 | (copy-file source target) |
| 2284 | ;; :type 'file-already-exists)) | 2283 | :type 'file-already-exists)) |
| 2285 | (copy-file source target 'ok)) | 2284 | (copy-file source target 'ok)) |
| 2286 | 2285 | ||
| 2287 | ;; Cleanup. | 2286 | ;; Cleanup. |
| @@ -2297,11 +2296,11 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 2297 | (should (file-exists-p source)) | 2296 | (should (file-exists-p source)) |
| 2298 | (make-directory target) | 2297 | (make-directory target) |
| 2299 | (should (file-directory-p target)) | 2298 | (should (file-directory-p target)) |
| 2300 | ;; ;; This has been changed in Emacs 26.1. | 2299 | ;; This has been changed in Emacs 26.1. |
| 2301 | ;; (when (and (tramp--test-expensive-test) (tramp--test-emacs26-p)) | 2300 | (when (and (tramp--test-expensive-test) (tramp--test-emacs26-p)) |
| 2302 | ;; (should-error | 2301 | (should-error |
| 2303 | ;; (copy-file source target) | 2302 | (copy-file source target) |
| 2304 | ;; :type 'file-already-exists)) | 2303 | :type 'file-already-exists)) |
| 2305 | (copy-file source (file-name-as-directory target)) | 2304 | (copy-file source (file-name-as-directory target)) |
| 2306 | (should | 2305 | (should |
| 2307 | (file-exists-p | 2306 | (file-exists-p |
| @@ -2358,7 +2357,7 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 2358 | 2357 | ||
| 2359 | ;; Cleanup. | 2358 | ;; Cleanup. |
| 2360 | (ignore-errors (delete-directory source 'recursive)) | 2359 | (ignore-errors (delete-directory source 'recursive)) |
| 2361 | (ignore-errors (delete-directory target 'recursive))))))))) | 2360 | (ignore-errors (delete-directory target 'recursive)))))))) |
| 2362 | 2361 | ||
| 2363 | (ert-deftest tramp-test12-rename-file () | 2362 | (ert-deftest tramp-test12-rename-file () |
| 2364 | "Check `rename-file'." | 2363 | "Check `rename-file'." |