diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2013-01-24 10:50:02 +0100 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2013-01-24 10:50:02 +0100 |
commit | e1ffa412b4ebd244c834854098031756743236e0 (patch) | |
tree | f9e65045f261cd2881c153f3c167be9d24742922 /lisp/net | |
parent | 7ff2b2a628fe6d6eb99038fb1e7d8cd086257742 (diff) | |
download | emacs-e1ffa412b4ebd244c834854098031756743236e0.tar.gz emacs-e1ffa412b4ebd244c834854098031756743236e0.tar.bz2 emacs-e1ffa412b4ebd244c834854098031756743236e0.zip |
* net/tramp.el (tramp-tramp-file-p): Check, whether NAME is unibyte.
* net/tramp-sh.el (tramp-sh-handle-set-file-acl): Do not suppress
basic attributes.
(tramp-sh-handle-set-file-acl): Improve error checking.
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/tramp-sh.el | 31 | ||||
-rw-r--r-- | lisp/net/tramp.el | 7 |
2 files changed, 20 insertions, 18 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 743c8dbe0f9..21c747967af 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1549,7 +1549,7 @@ be non-negative integers." (when (and (tramp-remote-acl-p v) (tramp-send-command-and-check v (format - "getfacl -acs %s 2>/dev/null" + "getfacl -ac %s 2>/dev/null" (tramp-shell-quote-argument localname)))) (with-current-buffer (tramp-get-connection-buffer v) (goto-char (point-max)) @@ -1560,21 +1560,20 @@ be non-negative integers." (defun tramp-sh-handle-set-file-acl (filename acl-string) "Like `set-file-acl' for Tramp files." - (with-parsed-tramp-file-name filename nil - (when (tramp-remote-acl-p v) - (condition-case nil - (when (stringp acl-string) - (tramp-set-file-property v localname "file-acl" acl-string) - (dolist (line (split-string acl-string nil t) t) - (unless (tramp-send-command-and-check - v (format - "setfacl -m %s %s" - line (tramp-shell-quote-argument localname))) - (error nil)))) - ;; In case of errors, we return `nil'. - (error - (tramp-set-file-property v localname "file-acl" 'undef) - nil))))) + (with-parsed-tramp-file-name (expand-file-name filename) nil + (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)) + (tramp-send-command-and-check v nil))) + ;; Success. + (progn + (tramp-set-file-property v localname "file-acl" acl-string) + t) + ;; In case of errors, we return `nil'. + (tramp-set-file-property v localname "file-acl-string" 'undef) + nil))) ;; Simple functions using the `test' command. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 69e82de3f7f..045304cbc4f 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1140,9 +1140,12 @@ If the `tramp-methods' entry does not exist, return nil." ;;;###tramp-autoload (defun tramp-tramp-file-p (name) - "Return t if NAME is a string with Tramp file name syntax." + "Return t if NAME is a string with Tramp file name syntax. +It checks also, whether NAME is unibyte encoded." (save-match-data - (and (stringp name) (string-match tramp-file-name-regexp name)))) + (and (stringp name) + (string-equal name (string-as-unibyte name)) + (string-match tramp-file-name-regexp name)))) (defun tramp-find-method (method user host) "Return the right method string to use. |