emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111376: * net/tramp-sh.el (tramp-sh-


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111376: * net/tramp-sh.el (tramp-sh-handle-file-acl): Suppress basic attributes.
Date: Sat, 29 Dec 2012 20:11:11 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111376
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Sat 2012-12-29 20:11:11 +0100
message:
  * net/tramp-sh.el (tramp-sh-handle-file-acl): Suppress basic attributes.
  (tramp-sh-handle-set-file-acl): Return `t' on success.
modified:
  lisp/ChangeLog
  lisp/net/tramp-sh.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-12-29 14:58:41 +0000
+++ b/lisp/ChangeLog    2012-12-29 19:11:11 +0000
@@ -1,3 +1,8 @@
+2012-12-29  Michael Albinus  <address@hidden>
+
+       * 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  <address@hidden>
 
        * files.el (backup-buffer-copy, basic-save-buffer-2): If

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2012-12-27 19:00:57 +0000
+++ b/lisp/net/tramp-sh.el      2012-12-29 19:11:11 +0000
@@ -1547,25 +1547,31 @@
       (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.
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]