/[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.273 by kai, Mon Feb 3 20:16:47 2003 UTC revision 2.274 by albinus, Tue Feb 4 22:37:29 2003 UTC
# Line 2351  if the remote host can't provide the mod Line 2351  if the remote host can't provide the mod
2351    ;; Method, host, etc, are unchanged.  Does it make sense to try    ;; Method, host, etc, are unchanged.  Does it make sense to try
2352    ;; to avoid parsing the filename?    ;; to avoid parsing the filename?
2353    (with-parsed-tramp-file-name directory nil    (with-parsed-tramp-file-name directory nil
2354      (if (and (eq (aref path (1- (length path))) ?/)      (if (and (not (zerop (length path)))
2355                 (eq (aref path (1- (length path))) ?/)
2356               (not (string= path "/")))               (not (string= path "/")))
2357          (substring directory 0 -1)          (substring directory 0 -1)
2358        directory)))        directory)))
# Line 3626  necessary anymore." Line 3627  necessary anymore."
3627               (host (tramp-file-name-host car))               (host (tramp-file-name-host car))
3628               (path (tramp-file-name-path car))               (path (tramp-file-name-path car))
3629               (m (tramp-find-method multi-method method user host))               (m (tramp-find-method multi-method method user host))
3630                 (tramp-current-user user) ; see `tramp-parse-passwd'
3631               all-user-hosts)               all-user-hosts)
3632    
3633          (unless (or multi-method ;; Not handled (yet).          (unless (or multi-method ;; Not handled (yet).
# Line 3953  User is always nil." Line 3955  User is always nil."
3955        (forward-line 1))        (forward-line 1))
3956       result))       result))
3957    
3958    ;; For su-alike methods it would be desirable to return "root@localhost"
3959    ;; as default.  Unfortunately, we have no information whether any user name
3960    ;; has been typed already.  So we (mis-)use tramp-current-user as indication,
3961    ;; assuming it is set in `tramp-completion-handle-file-name-all-completions'.
3962  (defun tramp-parse-passwd (filename)  (defun tramp-parse-passwd (filename)
3963    "Return a list of (user host) tuples allowed to access.    "Return a list of (user host) tuples allowed to access.
3964  Host is always \"localhost\"."  Host is always \"localhost\"."
3965    
3966    (let (res)    (let (res)
3967      (if (and (symbolp 'user) (zerop (length user)))      (if (zerop (length tramp-current-user))
3968          '(("root" nil))          '(("root" nil))
3969        (when (file-readable-p filename)        (when (file-readable-p filename)
3970          (with-temp-buffer          (with-temp-buffer
# Line 5612  running as USER on HOST using METHOD." Line 5618  running as USER on HOST using METHOD."
5618                 (tramp-get-buffer multi-method method user host))))                 (tramp-get-buffer multi-method method user host))))
5619      (unless proc      (unless proc
5620        (error "Can't send region to remote host -- not logged in"))        (error "Can't send region to remote host -- not logged in"))
5621      (if tramp-chunksize      (if (not (zerop tramp-chunksize))
5622          (let ((pos start))          (let ((pos start))
5623            (while (< pos end)            (while (< pos end)
5624              (tramp-message-for-buffer              (tramp-message-for-buffer

Legend:
Removed from v.2.273  
changed lines
  Added in v.2.274

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