* net/tramp-sh.el (tramp-sh-handle-file-acl): Suppress basic attributes.

(tramp-sh-handle-set-file-acl): Return `t' on success.
This commit is contained in:
Michael Albinus 2012-12-29 20:11:11 +01:00
parent 4d4056371f
commit eff2eb5812
2 changed files with 22 additions and 11 deletions

View file

@ -1,3 +1,8 @@
2012-12-29 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-sh.el (tramp-sh-handle-file-acl): Suppress basic attributes.
(tramp-sh-handle-set-file-acl): Return `t' on success.
2012-12-29 Eli Zaretskii <eliz@gnu.org>
* files.el (backup-buffer-copy, basic-save-buffer-2): If

View file

@ -1547,25 +1547,31 @@ and gid of the corresponding user is taken. Both parameters must be integers."
(when (and (tramp-remote-acl-p v)
(tramp-send-command-and-check
v (format
"getfacl -ac %s 2>/dev/null"
"getfacl -acs %s 2>/dev/null"
(tramp-shell-quote-argument localname))))
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-max))
(delete-blank-lines)
(substring-no-properties (buffer-string)))))))
(when (> (point-max) (point-min))
(substring-no-properties (buffer-string))))))))
(defun tramp-sh-handle-set-file-acl (filename acl-string)
"Like `set-file-acl' for Tramp files."
(with-parsed-tramp-file-name filename nil
(if (and (stringp acl-string)
(tramp-remote-acl-p v)
(tramp-send-command-and-check
v (format "setfacl --set-file=- %s <<'EOF'\n%s\nEOF\n"
(tramp-shell-quote-argument localname) acl-string)))
(tramp-set-file-property v localname "file-acl" acl-string)
(tramp-set-file-property v localname "file-acl-string" 'undef)))
;; We always return nil.
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))))
;; In case of errors, we return `nil'.
(error
(tramp-set-file-property v localname "file-acl" 'undef)
nil)))))
;; Simple functions using the `test' command.