/[tramp]/tramp/lisp/tramp.el
ViewVC logotype

Diff of /tramp/lisp/tramp.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2.216 by kai, Fri Sep 20 15:33:41 2002 UTC revision 2.217 by kai, Fri Sep 20 16:27:58 2002 UTC
# Line 713  See `tramp-methods' for a list of possib Line 713  See `tramp-methods' for a list of possib
713    "*Alist of methods for remote files.    "*Alist of methods for remote files.
714  This is a list of entries of the form (NAME PAIR1 PAIR2 ...).  This is a list of entries of the form (NAME PAIR1 PAIR2 ...).
715  Each NAME stands for a remote access method.  Each PAIR is of the form  Each NAME stands for a remote access method.  Each PAIR is of the form
716  (FUNCTION FILE).  FUNCTION is responsible to extract user names and host  \(FUNCTION FILE).  FUNCTION is responsible to extract user names and host
717  names from FILE for completion.  The following predefined FUNCTIONs exists:  names from FILE for completion.  The following predefined FUNCTIONs exists:
718    
719   * `tramp-parse-rhosts' for \".rhosts\" like files,   * `tramp-parse-rhosts' for \".rhosts\" like files,
# Line 934  Derived from `tramp-postfix-multi-hop-fo Line 934  Derived from `tramp-postfix-multi-hop-fo
934    :type 'regexp)    :type 'regexp)
935    
936  (defcustom tramp-user-regexp  (defcustom tramp-user-regexp
937    "[^:@/]+"    "[^:@/]*"
938    "*Regexp matching user names."    "*Regexp matching user names."
939    :group 'tramp    :group 'tramp
940    :type 'regexp)    :type 'regexp)
# Line 954  Derived from `tramp-postfix-user-format' Line 954  Derived from `tramp-postfix-user-format'
954    :type 'regexp)    :type 'regexp)
955    
956  (defcustom tramp-host-regexp  (defcustom tramp-host-regexp
957    "[a-zA-Z0-9_.-]+"    "[a-zA-Z0-9_.-]*"
958    "*Regexp matching host names."    "*Regexp matching host names."
959    :group 'tramp    :group 'tramp
960    :type 'regexp)    :type 'regexp)
# Line 3079  This will break if COMMAND prints a newl Line 3079  This will break if COMMAND prints a newl
3079          ;; Now `last-coding-system-used' has right value.  Remember it.          ;; Now `last-coding-system-used' has right value.  Remember it.
3080          (when (boundp 'last-coding-system-used)          (when (boundp 'last-coding-system-used)
3081            (setq coding-system-used last-coding-system-used))            (setq coding-system-used last-coding-system-used))
3082          (tramp-message 9 "Inserting local temp file `%s'...done" local-copy)          (tramp-message-for-buffer
3083             multi-method method user host
3084             9 "Inserting local temp file `%s'...done" local-copy)
3085          (delete-file local-copy)          (delete-file local-copy)
3086          (when (boundp 'last-coding-system-used)          (when (boundp 'last-coding-system-used)
3087            (setq last-coding-system-used coding-system-used))            (setq last-coding-system-used coding-system-used))
# Line 4512  arguments, and xx will be used as the ho Line 4514  arguments, and xx will be used as the ho
4514      (when multi-method      (when multi-method
4515        (error "Cannot multi-connect using rsh connection method"))        (error "Cannot multi-connect using rsh connection method"))
4516      (tramp-pre-connection multi-method method user host)      (tramp-pre-connection multi-method method user host)
4517      (if user      (if (and user (not (string= user "")))
4518          (tramp-message 7 "Opening connection for %s@%s using %s..."          (tramp-message 7 "Opening connection for %s@%s using %s..."
4519                         user host method)                         user host method)
4520        (tramp-message 7 "Opening connection at %s using %s..." host method))        (tramp-message 7 "Opening connection at %s using %s..." host method))
# Line 4534  arguments, and xx will be used as the ho Line 4536  arguments, and xx will be used as the ho
4536               (coding-system-for-read (unless (and (not (featurep 'xemacs))               (coding-system-for-read (unless (and (not (featurep 'xemacs))
4537                                                    (> emacs-major-version 20))                                                    (> emacs-major-version 20))
4538                                         tramp-dos-coding-system))                                         tramp-dos-coding-system))
4539               (p (if user               (p (if (and user (not (string= user "")))
4540                      (apply #'start-process bufnam buf rsh-program                        (apply #'start-process bufnam buf rsh-program  
4541                             host "-l" user rsh-args)                             host "-l" user rsh-args)
4542                    (apply #'start-process bufnam buf rsh-program                    (apply #'start-process bufnam buf rsh-program
# Line 4568  prompt than you do, so it is not at all Line 4570  prompt than you do, so it is not at all
4570               method))               method))
4571      (unless (or (string-match (concat "^" (regexp-quote host))      (unless (or (string-match (concat "^" (regexp-quote host))
4572                                (system-name))                                (system-name))
4573                  (string= "localhost" host))                  (string= "localhost" host)
4574                    (string= "" host))
4575        (error        (error
4576         "Cannot connect to different host `%s' with `su' connection method"         "Cannot connect to different host `%s' with `su' connection method"
4577         host))         host))
     (when (not user)  
       (setq user "root"))  
4578      (tramp-pre-connection multi-method method user host)      (tramp-pre-connection multi-method method user host)
4579      (tramp-message 7 "Opening connection for `%s' using `%s'..." user method)      (tramp-message 7 "Opening connection for `%s' using `%s'..."
4580                       (or user "<root>") method)
4581      (let ((process-environment (copy-sequence process-environment)))      (let ((process-environment (copy-sequence process-environment)))
4582        (setenv "TERM" tramp-terminal-type)        (setenv "TERM" tramp-terminal-type)
4583        (let* ((default-directory (tramp-temporary-file-directory))        (let* ((default-directory (tramp-temporary-file-directory))
# Line 4591  prompt than you do, so it is not at all Line 4593  prompt than you do, so it is not at all
4593                         (tramp-get-su-program multi-method method)                         (tramp-get-su-program multi-method method)
4594                         (mapcar                         (mapcar
4595                          '(lambda (x)                          '(lambda (x)
4596                             (format-spec x `((?u . ,user))))                             (format-spec x `((?u . ,(or user "root")))))
4597                          (tramp-get-su-args multi-method method))))                          (tramp-get-su-args multi-method method))))
4598               (found nil)               (found nil)
4599               (pw nil))               (pw nil))

Legend:
Removed from v.2.216  
changed lines
  Added in v.2.217

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26