diff options
| author | Joakim Verona | 2012-12-30 00:03:52 +0100 |
|---|---|---|
| committer | Joakim Verona | 2012-12-30 00:03:52 +0100 |
| commit | ea2da3d8fbf19765a9bd82292bfc73918f74048d (patch) | |
| tree | b350dbdaa6601f4384a3fbde01eeaea297d4f047 /lisp/net | |
| parent | 16b9f224223b3e9eb0c4b313e4257dacbd3ebe34 (diff) | |
| parent | eff2eb5812e964024c3aa20197b21f12d37155dd (diff) | |
| download | emacs-ea2da3d8fbf19765a9bd82292bfc73918f74048d.tar.gz emacs-ea2da3d8fbf19765a9bd82292bfc73918f74048d.zip | |
auto upstream
Diffstat (limited to 'lisp/net')
| -rw-r--r-- | lisp/net/tramp-sh.el | 28 |
1 files changed, 17 insertions, 11 deletions
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 | ||