emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r116689: * net/tramp.el (tramp-error): VEC-OR-PROC c


From: Michael Albinus
Subject: [Emacs-diffs] trunk r116689: * net/tramp.el (tramp-error): VEC-OR-PROC can be nil.
Date: Thu, 06 Mar 2014 13:23:10 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116689
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Thu 2014-03-06 14:23:04 +0100
message:
  * net/tramp.el (tramp-error): VEC-OR-PROC can be nil.
  (tramp-action-password): Clear password cache if needed.
  (tramp-read-passwd): Do not clear password cache.
  
  * net/tramp-gvfs.el (tramp-gvfs-handler-askpassword): Clear password
  cache unless it is the first password request.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/tramp-gvfs.el         
trampgvfs.el-20091113204419-o5vbwnq5f7feedwu-10898
  lisp/net/tramp.el              tramp.el-20091113204419-o5vbwnq5f7feedwu-2427
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-03-06 04:11:08 +0000
+++ b/lisp/ChangeLog    2014-03-06 13:23:04 +0000
@@ -1,3 +1,12 @@
+2014-03-06  Michael Albinus  <address@hidden>
+
+       * net/tramp.el (tramp-error): VEC-OR-PROC can be nil.
+       (tramp-action-password): Clear password cache if needed.
+       (tramp-read-passwd): Do not clear password cache.
+
+       * net/tramp-gvfs.el (tramp-gvfs-handler-askpassword): Clear password
+       cache unless it is the first password request.
+
 2014-03-06  Glenn Morris  <address@hidden>
 
        * simple.el (newline): Doc tweak.

=== modified file 'lisp/net/tramp-gvfs.el'
--- a/lisp/net/tramp-gvfs.el    2014-02-20 14:24:13 +0000
+++ b/lisp/net/tramp-gvfs.el    2014-03-06 13:23:04 +0000
@@ -1180,10 +1180,14 @@
                      (zerop (logand flags tramp-gvfs-password-need-username))))
            (setq user (read-string "User name: ")))
          (when (and (zerop (length domain))
-                    (not (zerop (logand flags 
tramp-gvfs-password-need-domain))))
+                    (not
+                     (zerop (logand flags tramp-gvfs-password-need-domain))))
            (setq domain (read-string "Domain name: ")))
 
          (tramp-message l 6 "%S %S %S %d" message user domain flags)
+         (unless (tramp-get-connection-property l "first-password-request" nil)
+           (tramp-clear-passwd l))
+
          (setq tramp-current-method l-method
                tramp-current-user user
                tramp-current-host l-host
@@ -1474,7 +1478,7 @@
              (format "Opening connection for %s using %s" host method)
            (format "Opening connection for address@hidden using %s" user host 
method))
 
-       ;; Enable auth-source and password-cache.
+       ;; Enable `auth-source'.
        (tramp-set-connection-property vec "first-password-request" t)
 
        ;; There will be a callback of "askPassword" when a password is

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2014-02-27 11:59:04 +0000
+++ b/lisp/net/tramp.el 2014-03-06 13:23:04 +0000
@@ -1560,12 +1560,13 @@
 `tramp-message'.  Finally, signal SIGNAL is raised."
   (let (tramp-message-show-message)
     (tramp-backtrace vec-or-proc)
-    (tramp-message
-     vec-or-proc 1 "%s"
-     (error-message-string
-      (list signal
-           (get signal 'error-message)
-           (apply 'format fmt-string arguments))))
+    (when vec-or-proc
+      (tramp-message
+       vec-or-proc 1 "%s"
+       (error-message-string
+       (list signal
+             (get signal 'error-message)
+             (apply 'format fmt-string arguments)))))
     (signal signal (list (apply 'format fmt-string arguments)))))
 
 (defsubst tramp-error-with-buffer
@@ -3400,6 +3401,12 @@
   (with-current-buffer (process-buffer proc)
     (let ((enable-recursive-minibuffers t)
          (case-fold-search t))
+      ;; Let's check whether a wrong password has been sent already.
+      ;; Sometimes, the process returns a new password request
+      ;; immediately after rejecting the previous (wrong) one.
+      (goto-char (point-min))
+      (when (search-forward-regexp tramp-wrong-passwd-regexp nil t)
+       (tramp-clear-passwd vec))
       (tramp-check-for-regexp proc tramp-password-prompt-regexp)
       (tramp-message vec 3 "Sending %s" (match-string 1))
       ;; We don't call `tramp-send-string' in order to hide the
@@ -3508,8 +3515,8 @@
 PROC and VEC indicate the remote connection to be used.  POS, if
 set, is the starting point of the region to be deleted in the
 connection buffer."
-  ;; Enable `auth-source' and `password-cache'.  We must use
-  ;; tramp-current-* variables in case we have several hops.
+  ;; Enable `auth-source'.  We must use tramp-current-* variables in
+  ;; case we have several hops.
   (tramp-set-connection-property
    (tramp-dissect-file-name
     (tramp-make-tramp-file-name
@@ -4131,9 +4138,6 @@
                    "password" tramp-current-host tramp-current-method)))
           ;; Try the password cache.
           (when (functionp 'password-read)
-            (unless (tramp-get-connection-property
-                     v "first-password-request" nil)
-              (tramp-compat-funcall 'password-cache-remove key))
             (let ((password
                    (tramp-compat-funcall 'password-read pw-prompt key)))
               (tramp-compat-funcall 'password-cache-add key password)


reply via email to

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