emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r111927: * net/tramp-adb.el (tramp-ad


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111927: * net/tramp-adb.el (tramp-adb-maybe-open-connection): Cache,
Date: Sun, 03 Mar 2013 11:31:01 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111927
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Sun 2013-03-03 11:31:01 +0100
message:
  * net/tramp-adb.el (tramp-adb-maybe-open-connection): Cache,
  whether the "su" command is available on the device.
modified:
  lisp/ChangeLog
  lisp/net/tramp-adb.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-03-01 21:12:26 +0000
+++ b/lisp/ChangeLog    2013-03-03 10:31:01 +0000
@@ -1,3 +1,8 @@
+2013-03-03  Michael Albinus  <address@hidden>
+
+       * net/tramp-adb.el (tramp-adb-maybe-open-connection): Cache,
+       whether the "su" command is available on the device.
+
 2013-03-01  Michael Albinus  <address@hidden>
 
        * net/tramp-adb.el (tramp-adb-prompt): Extend regexp.

=== modified file 'lisp/net/tramp-adb.el'
--- a/lisp/net/tramp-adb.el     2013-03-01 21:12:26 +0000
+++ b/lisp/net/tramp-adb.el     2013-03-03 10:31:01 +0000
@@ -1074,6 +1074,13 @@
         (host (tramp-file-name-host vec))
         (user (tramp-file-name-user vec))
         (devices (mapcar 'cadr (tramp-adb-parse-device-names nil))))
+
+    ;; Maybe we know already that "su" is not supported.  We cannot
+    ;; use a connection property, because we have not checked yet
+    ;; whether it is still the same device.
+    (when (and user (not (tramp-get-file-property vec "" "su-command-p" t)))
+      (tramp-error vec 'file-error "Cannot switch to user `%s'" user))
+
     (unless
        (and p (processp p) (memq (process-status p) '(run open)))
       (save-match-data
@@ -1133,7 +1140,9 @@
              (tramp-adb-send-command vec (format "su %s" user))
              (unless (zerop (tramp-adb-command-exit-status vec nil))
                (delete-process p)
-               (tramp-error vec 'file-error "Cannot switch to user %s" user)))
+               (tramp-set-file-property vec "" "su-command-p" nil)
+               (tramp-error
+                vec 'file-error "Cannot switch to user `%s'" user)))
 
            ;; Set "remote-path" connection property.  This is needed
            ;; for eshell.


reply via email to

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