From: Michael Albinus Date: Sun, 18 Dec 2022 19:17:06 +0000 (+0100) Subject: Fix recent change in tramp-smb.el X-Git-Tag: emacs-29.0.90~1076 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c1e015ae320c7ea0f9ca764b2df5fcd6f0d39994;p=emacs.git Fix recent change in tramp-smb.el * 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'. --- diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 24fff9bb495..cd73b9b8eca 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -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")) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 9b7117cb875..ca8963fbf54 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -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.