]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix wdired-do-perm-changes when over Tramp
authorTino Calancha <tino.calancha@gmail.com>
Thu, 1 Oct 2020 21:33:56 +0000 (23:33 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 1 Oct 2020 21:34:01 +0000 (23:34 +0200)
* lisp/wdired.el (wdired-do-perm-changes) Use set-file-modes
instead of external program (bug#39284).  This fixes the problem
of passing the wrong argument to the external chmod.

lisp/wdired.el

index 806eb304d9fffd0fa161ebbf779af6bb15770f85..40f4cd97190669424330c491cea98bd3b0221159 100644 (file)
@@ -913,9 +913,9 @@ Like original function but it skips read-only words."
         (if (= (length perms-new) 10)
             (progn
               (setq perm-tmp
-                    (int-to-string (wdired-perms-to-number perms-new)))
-              (unless (equal 0 (process-file dired-chmod-program
-                                            nil nil nil perm-tmp filename))
+                    (string-to-number
+                     (int-to-string (wdired-perms-to-number perms-new)) 8))
+              (unless (set-file-modes filename perm-tmp)
                 (setq errors (1+ errors))
                 (dired-log "%s %s `%s' failed\n\n"
                            dired-chmod-program perm-tmp filename)))