diff options
| author | Michael Albinus | 2012-12-29 20:11:11 +0100 |
|---|---|---|
| committer | Michael Albinus | 2012-12-29 20:11:11 +0100 |
| commit | eff2eb5812e964024c3aa20197b21f12d37155dd (patch) | |
| tree | 16276bb60d997ad767283ecdef1ab05258eb517f | |
| parent | 4d4056371fef0661d65b9cb3aa91de1fd4c7c010 (diff) | |
| download | emacs-eff2eb5812e964024c3aa20197b21f12d37155dd.tar.gz emacs-eff2eb5812e964024c3aa20197b21f12d37155dd.zip | |
* net/tramp-sh.el (tramp-sh-handle-file-acl): Suppress basic attributes.
(tramp-sh-handle-set-file-acl): Return `t' on success.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 28 |
2 files changed, 22 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c41cfe1b25f..81b4978dba5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-12-29 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-sh.el (tramp-sh-handle-file-acl): Suppress basic attributes. | ||
| 4 | (tramp-sh-handle-set-file-acl): Return `t' on success. | ||
| 5 | |||
| 1 | 2012-12-29 Eli Zaretskii <eliz@gnu.org> | 6 | 2012-12-29 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * files.el (backup-buffer-copy, basic-save-buffer-2): If | 8 | * files.el (backup-buffer-copy, basic-save-buffer-2): If |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 67459b4f9ca..ebc377c08c8 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -1547,25 +1547,31 @@ and gid of the corresponding user is taken. Both parameters must be integers." | |||
| 1547 | (when (and (tramp-remote-acl-p v) | 1547 | (when (and (tramp-remote-acl-p v) |
| 1548 | (tramp-send-command-and-check | 1548 | (tramp-send-command-and-check |
| 1549 | v (format | 1549 | v (format |
| 1550 | "getfacl -ac %s 2>/dev/null" | 1550 | "getfacl -acs %s 2>/dev/null" |
| 1551 | (tramp-shell-quote-argument localname)))) | 1551 | (tramp-shell-quote-argument localname)))) |
| 1552 | (with-current-buffer (tramp-get-connection-buffer v) | 1552 | (with-current-buffer (tramp-get-connection-buffer v) |
| 1553 | (goto-char (point-max)) | 1553 | (goto-char (point-max)) |
| 1554 | (delete-blank-lines) | 1554 | (delete-blank-lines) |
| 1555 | (substring-no-properties (buffer-string))))))) | 1555 | (when (> (point-max) (point-min)) |
| 1556 | (substring-no-properties (buffer-string)))))))) | ||
| 1556 | 1557 | ||
| 1557 | (defun tramp-sh-handle-set-file-acl (filename acl-string) | 1558 | (defun tramp-sh-handle-set-file-acl (filename acl-string) |
| 1558 | "Like `set-file-acl' for Tramp files." | 1559 | "Like `set-file-acl' for Tramp files." |
| 1559 | (with-parsed-tramp-file-name filename nil | 1560 | (with-parsed-tramp-file-name filename nil |
| 1560 | (if (and (stringp acl-string) | 1561 | (when (tramp-remote-acl-p v) |
| 1561 | (tramp-remote-acl-p v) | 1562 | (condition-case nil |
| 1562 | (tramp-send-command-and-check | 1563 | (when (stringp acl-string) |
| 1563 | v (format "setfacl --set-file=- %s <<'EOF'\n%s\nEOF\n" | 1564 | (tramp-set-file-property v localname "file-acl" acl-string) |
| 1564 | (tramp-shell-quote-argument localname) acl-string))) | 1565 | (dolist (line (split-string acl-string nil t) t) |
| 1565 | (tramp-set-file-property v localname "file-acl" acl-string) | 1566 | (unless (tramp-send-command-and-check |
| 1566 | (tramp-set-file-property v localname "file-acl-string" 'undef))) | 1567 | v (format |
| 1567 | ;; We always return nil. | 1568 | "setfacl -m %s %s" |
| 1568 | nil) | 1569 | line (tramp-shell-quote-argument localname))) |
| 1570 | (error)))) | ||
| 1571 | ;; In case of errors, we return `nil'. | ||
| 1572 | (error | ||
| 1573 | (tramp-set-file-property v localname "file-acl" 'undef) | ||
| 1574 | nil))))) | ||
| 1569 | 1575 | ||
| 1570 | ;; Simple functions using the `test' command. | 1576 | ;; Simple functions using the `test' command. |
| 1571 | 1577 | ||