aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2019-01-24 17:40:10 +0100
committerMichael Albinus2019-01-24 17:40:10 +0100
commit7960951d5df714957bcfff82df77a94a6ee8960b (patch)
tree9a5c3bda9eb87505520fa75ebf59588077db9a2a
parent36a748091d037ec2b3f3d4de1ac4ab09d90fc168 (diff)
downloademacs-7960951d5df714957bcfff82df77a94a6ee8960b.tar.gz
emacs-7960951d5df714957bcfff82df77a94a6ee8960b.zip
Some fixes in tramp-smb.el
* lisp/net/tramp-smb.el (tramp-smb-errors): Add "NT_STATUS_NOT_A_DIRECTORY". (tramp-smb-maybe-open-connection): Respect ´non-essential'. Do not record smbserver-version. (tramp-smb-wait-for-output): Improve reading pending output.
-rw-r--r--lisp/net/tramp-smb.el45
1 files changed, 30 insertions, 15 deletions
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 08f2f30747a..7163afdcea0 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -144,6 +144,7 @@ call, letting the SMB client use the default one."
144 "NT_STATUS_NO_LOGON_SERVERS" 144 "NT_STATUS_NO_LOGON_SERVERS"
145 "NT_STATUS_NO_SUCH_FILE" 145 "NT_STATUS_NO_SUCH_FILE"
146 "NT_STATUS_NO_SUCH_USER" 146 "NT_STATUS_NO_SUCH_USER"
147 "NT_STATUS_NOT_A_DIRECTORY"
147 "NT_STATUS_OBJECT_NAME_COLLISION" 148 "NT_STATUS_OBJECT_NAME_COLLISION"
148 "NT_STATUS_OBJECT_NAME_INVALID" 149 "NT_STATUS_OBJECT_NAME_INVALID"
149 "NT_STATUS_OBJECT_NAME_NOT_FOUND" 150 "NT_STATUS_OBJECT_NAME_NOT_FOUND"
@@ -1913,6 +1914,14 @@ If ARGUMENT is non-nil, use it as argument for
1913 share 1914 share
1914 (tramp-get-connection-property p "smb-share" "")))) 1915 (tramp-get-connection-property p "smb-share" ""))))
1915 1916
1917 ;; During completion, don't reopen a new connection. We
1918 ;; check this for the process related to
1919 ;; `tramp-buffer-name'; otherwise `start-file-process'
1920 ;; wouldn't run ever when `non-essential' is non-nil.
1921 (when (and (tramp-completion-mode-p)
1922 (null (get-process (tramp-buffer-name vec))))
1923 (throw 'non-essential 'non-essential))
1924
1916 (save-match-data 1925 (save-match-data
1917 ;; There might be unread output from checking for share names. 1926 ;; There might be unread output from checking for share names.
1918 (when buf (with-current-buffer buf (erase-buffer))) 1927 (when buf (with-current-buffer buf (erase-buffer)))
@@ -1977,20 +1986,22 @@ If ARGUMENT is non-nil, use it as argument for
1977 tramp-smb-actions-without-share)) 1986 tramp-smb-actions-without-share))
1978 1987
1979 ;; Check server version. 1988 ;; Check server version.
1980 (unless argument 1989 ;; FIXME: With recent smbclient versions, this
1981 (with-current-buffer (tramp-get-connection-buffer vec) 1990 ;; information isn't printed anymore.
1982 (goto-char (point-min)) 1991 ;; (unless argument
1983 (search-forward-regexp tramp-smb-server-version nil t) 1992 ;; (with-current-buffer (tramp-get-connection-buffer vec)
1984 (let ((smbserver-version (match-string 0))) 1993 ;; (goto-char (point-min))
1985 (unless 1994 ;; (search-forward-regexp tramp-smb-server-version nil t)
1986 (string-equal 1995 ;; (let ((smbserver-version (match-string 0)))
1987 smbserver-version 1996 ;; (unless
1988 (tramp-get-connection-property 1997 ;; (string-equal
1989 vec "smbserver-version" smbserver-version)) 1998 ;; smbserver-version
1990 (tramp-flush-directory-properties vec "") 1999 ;; (tramp-get-connection-property
1991 (tramp-flush-connection-properties vec)) 2000 ;; vec "smbserver-version" smbserver-version))
1992 (tramp-set-connection-property 2001 ;; (tramp-flush-directory-properties vec "")
1993 vec "smbserver-version" smbserver-version)))) 2002 ;; (tramp-flush-connection-properties vec))
2003 ;; (tramp-set-connection-property
2004 ;; vec "smbserver-version" smbserver-version))))
1994 2005
1995 ;; Set chunksize to 1. smbclient reads its input 2006 ;; Set chunksize to 1. smbclient reads its input
1996 ;; character by character; if we send the string 2007 ;; character by character; if we send the string
@@ -2032,7 +2043,11 @@ Removes smb prompt. Returns nil if an error message has appeared."
2032 (inhibit-read-only t)) 2043 (inhibit-read-only t))
2033 2044
2034 ;; Read pending output. 2045 ;; Read pending output.
2035 (while (tramp-accept-process-output p 0.1)) 2046 (goto-char (point-min))
2047 (while (not (or (re-search-forward tramp-smb-prompt nil t)
2048 (re-search-forward tramp-smb-errors nil t)))
2049 (while (tramp-accept-process-output p 0.1)
2050 (goto-char (point-min))))
2036 (tramp-message vec 6 "\n%s" (buffer-string)) 2051 (tramp-message vec 6 "\n%s" (buffer-string))
2037 2052
2038 ;; Remove prompt. 2053 ;; Remove prompt.