]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix recent change in tramp-smb.el
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 18 Dec 2022 19:17:06 +0000 (20:17 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 18 Dec 2022 19:17:06 +0000 (20:17 +0100)
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Ignore `make-directory-internal'.
(tramp-smb-handle-make-directory): Move implementation from
`tramp-smb-handle-make-directory-internal' here.

* lisp/net/tramp.el (tramp-file-name-for-operation):
Rearrange `make-directory-internal'.

lisp/net/tramp-smb.el
lisp/net/tramp.el

index 24fff9bb495aab38da71b1a29a83f2c72b405f5b..cd73b9b8ecaad967a2df6d6463f15b7ee302db56 100644 (file)
@@ -279,7 +279,7 @@ See `tramp-actions-before-shell' for more info.")
     (lock-file . tramp-handle-lock-file)
     (make-auto-save-file-name . tramp-handle-make-auto-save-file-name)
     (make-directory . tramp-smb-handle-make-directory)
-    (make-directory-internal . tramp-smb-handle-make-directory-internal)
+    (make-directory-internal . ignore)
     (make-lock-file-name . tramp-handle-make-lock-file-name)
     (make-nearby-temp-file . tramp-handle-make-nearby-temp-file)
     (make-process . ignore)
@@ -1186,10 +1186,18 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
        (make-directory ldir parents))
       ;; Just do it.
       (when (file-directory-p ldir)
-       (make-directory dir))
+       (tramp-smb-send-command
+        v (if (tramp-smb-get-cifs-capabilities v)
+              (format "posix_mkdir %s %o"
+                      (tramp-smb-shell-quote-localname v) (default-file-modes))
+            (format "mkdir %s" (tramp-smb-shell-quote-localname v))))
+       ;; We must also flush the cache of the directory, because
+       ;; `file-attributes' reads the values from there.
+       (tramp-flush-file-properties v localname))
       (unless (file-directory-p dir)
        (tramp-error v 'file-error "Couldn't make directory %s" dir)))))
 
+;; This is not used anymore.
 (defun tramp-smb-handle-make-directory-internal (directory)
   "Like `make-directory-internal' for Tramp files."
   (declare (obsolete nil "29.1"))
index 9b7117cb875904316e2ba10bcc70f0a4a1706f2f..ca8963fbf548741e63d4fb7b164e7c9322f78994 100644 (file)
@@ -2605,12 +2605,14 @@ Must be handled by the callers."
              file-selinux-context file-symlink-p file-truename
              file-writable-p find-backup-file-name get-file-buffer
              insert-directory insert-file-contents load
-             make-directory make-directory-internal set-file-acl
-             set-file-modes set-file-selinux-context set-file-times
+             make-directory set-file-acl set-file-modes
+             set-file-selinux-context set-file-times
              substitute-in-file-name unhandled-file-name-directory
              vc-registered
              ;; Emacs 27+ only.
              file-system-info
+             ;; Emacs 28- only.
+             make-directory-internal
              ;; Emacs 28+ only.
              file-locked-p lock-file make-lock-file-name unlock-file
              ;; Emacs 29+ only.