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

Diff of /emacs/lisp/net/tramp.el

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

revision 1.38 by kai, Tue Jun 17 14:03:58 2003 UTC revision 1.39 by kai, Sun Jul 20 19:04:47 2003 UTC
# Line 238  This variable defaults to the value of ` Line 238  This variable defaults to the value of `
238                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
239                (tramp-login-args           nil)                (tramp-login-args           nil)
240                (tramp-copy-args            nil)                (tramp-copy-args            nil)
241                (tramp-copy-keep-date-arg   "-p"))                (tramp-copy-keep-date-arg   "-p")
242                  (tramp-password-end-of-line nil))
243       ("scp"   (tramp-connection-function  tramp-open-connection-rsh)       ("scp"   (tramp-connection-function  tramp-open-connection-rsh)
244                (tramp-login-program        "ssh")                (tramp-login-program        "ssh")
245                (tramp-copy-program         "scp")                (tramp-copy-program         "scp")
246                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
247                (tramp-login-args           ("-e" "none"))                (tramp-login-args           ("-e" "none"))
248                (tramp-copy-args            nil)                (tramp-copy-args            nil)
249                (tramp-copy-keep-date-arg   "-p"))                (tramp-copy-keep-date-arg   "-p")
250                  (tramp-password-end-of-line nil))
251       ("scp1"  (tramp-connection-function  tramp-open-connection-rsh)       ("scp1"  (tramp-connection-function  tramp-open-connection-rsh)
252                (tramp-login-program        "ssh")                (tramp-login-program        "ssh")
253                (tramp-copy-program         "scp")                (tramp-copy-program         "scp")
254                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
255                (tramp-login-args           ("-1" "-e" "none"))                (tramp-login-args           ("-1" "-e" "none"))
256                (tramp-copy-args            ("-1"))                (tramp-copy-args            ("-1"))
257                (tramp-copy-keep-date-arg   "-p"))                (tramp-copy-keep-date-arg   "-p")
258                  (tramp-password-end-of-line nil))
259       ("scp2"  (tramp-connection-function  tramp-open-connection-rsh)       ("scp2"  (tramp-connection-function  tramp-open-connection-rsh)
260                (tramp-login-program        "ssh")                (tramp-login-program        "ssh")
261                (tramp-copy-program         "scp")                (tramp-copy-program         "scp")
262                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
263                (tramp-login-args           ("-2" "-e" "none"))                (tramp-login-args           ("-2" "-e" "none"))
264                (tramp-copy-args            ("-2"))                (tramp-copy-args            ("-2"))
265                (tramp-copy-keep-date-arg   "-p"))                (tramp-copy-keep-date-arg   "-p")
266                  (tramp-password-end-of-line nil))
267       ("scp1_old"       ("scp1_old"
268                (tramp-connection-function  tramp-open-connection-rsh)                (tramp-connection-function  tramp-open-connection-rsh)
269                (tramp-login-program        "ssh1")                (tramp-login-program        "ssh1")
# Line 267  This variable defaults to the value of ` Line 271  This variable defaults to the value of `
271                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
272                (tramp-login-args           ("-e" "none"))                (tramp-login-args           ("-e" "none"))
273                (tramp-copy-args            nil)                (tramp-copy-args            nil)
274                (tramp-copy-keep-date-arg   "-p"))                (tramp-copy-keep-date-arg   "-p")
275                  (tramp-password-end-of-line nil))
276       ("scp2_old"       ("scp2_old"
277                (tramp-connection-function  tramp-open-connection-rsh)                (tramp-connection-function  tramp-open-connection-rsh)
278                (tramp-login-program        "ssh2")                (tramp-login-program        "ssh2")
# Line 275  This variable defaults to the value of ` Line 280  This variable defaults to the value of `
280                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
281                (tramp-login-args           ("-e" "none"))                (tramp-login-args           ("-e" "none"))
282                (tramp-copy-args            nil)                (tramp-copy-args            nil)
283                (tramp-copy-keep-date-arg   "-p"))                (tramp-copy-keep-date-arg   "-p")
284                  (tramp-password-end-of-line nil))
285       ("rsync" (tramp-connection-function  tramp-open-connection-rsh)       ("rsync" (tramp-connection-function  tramp-open-connection-rsh)
286                (tramp-login-program        "ssh")                (tramp-login-program        "ssh")
287                (tramp-copy-program         "rsync")                (tramp-copy-program         "rsync")
288                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
289                (tramp-login-args           ("-e" "none"))                (tramp-login-args           ("-e" "none"))
290                (tramp-copy-args            ("-e" "ssh"))                (tramp-copy-args            ("-e" "ssh"))
291                (tramp-copy-keep-date-arg   "-t"))                (tramp-copy-keep-date-arg   "-t")
292                  (tramp-password-end-of-line nil))
293       ("remcp" (tramp-connection-function  tramp-open-connection-rsh)       ("remcp" (tramp-connection-function  tramp-open-connection-rsh)
294                (tramp-login-program        "remsh")                (tramp-login-program        "remsh")
295                (tramp-copy-program         "rcp")                (tramp-copy-program         "rcp")
296                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
297                (tramp-login-args           nil)                (tramp-login-args           nil)
298                (tramp-copy-args            nil)                (tramp-copy-args            nil)
299                (tramp-copy-keep-date-arg   "-p"))                (tramp-copy-keep-date-arg   "-p")
300                  (tramp-password-end-of-line nil))
301       ("rsh"   (tramp-connection-function  tramp-open-connection-rsh)       ("rsh"   (tramp-connection-function  tramp-open-connection-rsh)
302                (tramp-login-program        "rsh")                (tramp-login-program        "rsh")
303                (tramp-copy-program         nil)                (tramp-copy-program         nil)
304                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
305                (tramp-login-args           nil)                (tramp-login-args           nil)
306                (tramp-copy-args            nil)                (tramp-copy-args            nil)
307                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
308                  (tramp-password-end-of-line nil))
309       ("ssh"   (tramp-connection-function  tramp-open-connection-rsh)       ("ssh"   (tramp-connection-function  tramp-open-connection-rsh)
310                (tramp-login-program        "ssh")                (tramp-login-program        "ssh")
311                (tramp-copy-program         nil)                (tramp-copy-program         nil)
312                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
313                (tramp-login-args           ("-e" "none"))                (tramp-login-args           ("-e" "none"))
314                (tramp-copy-args            nil)                (tramp-copy-args            nil)
315                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
316                  (tramp-password-end-of-line nil))
317       ("ssh1"  (tramp-connection-function  tramp-open-connection-rsh)       ("ssh1"  (tramp-connection-function  tramp-open-connection-rsh)
318                (tramp-login-program        "ssh")                (tramp-login-program        "ssh")
319                (tramp-copy-program         nil)                (tramp-copy-program         nil)
320                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
321                (tramp-login-args           ("-1" "-e" "none"))                (tramp-login-args           ("-1" "-e" "none"))
322                (tramp-copy-args            ("-1"))                (tramp-copy-args            ("-1"))
323                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
324                  (tramp-password-end-of-line nil))
325       ("ssh2"  (tramp-connection-function  tramp-open-connection-rsh)       ("ssh2"  (tramp-connection-function  tramp-open-connection-rsh)
326                (tramp-login-program        "ssh")                (tramp-login-program        "ssh")
327                (tramp-copy-program         nil)                (tramp-copy-program         nil)
328                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
329                (tramp-login-args           ("-2" "-e" "none"))                (tramp-login-args           ("-2" "-e" "none"))
330                (tramp-copy-args            ("-2"))                (tramp-copy-args            ("-2"))
331                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
332                  (tramp-password-end-of-line nil))
333       ("ssh1_old"       ("ssh1_old"
334                (tramp-connection-function  tramp-open-connection-rsh)                (tramp-connection-function  tramp-open-connection-rsh)
335                (tramp-login-program        "ssh1")                (tramp-login-program        "ssh1")
# Line 325  This variable defaults to the value of ` Line 337  This variable defaults to the value of `
337                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
338                (tramp-login-args           ("-e" "none"))                (tramp-login-args           ("-e" "none"))
339                (tramp-copy-args            nil)                (tramp-copy-args            nil)
340                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
341                  (tramp-password-end-of-line nil))
342       ("ssh2_old"       ("ssh2_old"
343                (tramp-connection-function  tramp-open-connection-rsh)                (tramp-connection-function  tramp-open-connection-rsh)
344                (tramp-login-program        "ssh2")                (tramp-login-program        "ssh2")
# Line 333  This variable defaults to the value of ` Line 346  This variable defaults to the value of `
346                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
347                (tramp-login-args           ("-e" "none"))                (tramp-login-args           ("-e" "none"))
348                (tramp-copy-args            nil)                (tramp-copy-args            nil)
349                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
350                  (tramp-password-end-of-line nil))
351       ("remsh" (tramp-connection-function  tramp-open-connection-rsh)       ("remsh" (tramp-connection-function  tramp-open-connection-rsh)
352                (tramp-login-program        "remsh")                (tramp-login-program        "remsh")
353                (tramp-copy-program         nil)                (tramp-copy-program         nil)
354                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
355                (tramp-login-args           nil)                (tramp-login-args           nil)
356                (tramp-copy-args            nil)                (tramp-copy-args            nil)
357                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
358                  (tramp-password-end-of-line nil))
359       ("telnet"       ("telnet"
360                (tramp-connection-function  tramp-open-connection-telnet)                (tramp-connection-function  tramp-open-connection-telnet)
361                (tramp-login-program        "telnet")                (tramp-login-program        "telnet")
# Line 348  This variable defaults to the value of ` Line 363  This variable defaults to the value of `
363                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
364                (tramp-login-args           nil)                (tramp-login-args           nil)
365                (tramp-copy-args            nil)                (tramp-copy-args            nil)
366                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
367                  (tramp-password-end-of-line nil))
368       ("su"    (tramp-connection-function  tramp-open-connection-su)       ("su"    (tramp-connection-function  tramp-open-connection-su)
369                (tramp-login-program        "su")                (tramp-login-program        "su")
370                (tramp-copy-program         nil)                (tramp-copy-program         nil)
371                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
372                (tramp-login-args           ("-" "%u"))                (tramp-login-args           ("-" "%u"))
373                (tramp-copy-args            nil)                (tramp-copy-args            nil)
374                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
375                  (tramp-password-end-of-line nil))
376       ("sudo"  (tramp-connection-function  tramp-open-connection-su)       ("sudo"  (tramp-connection-function  tramp-open-connection-su)
377                (tramp-login-program        "sudo")                (tramp-login-program        "sudo")
378                (tramp-copy-program         nil)                (tramp-copy-program         nil)
# Line 363  This variable defaults to the value of ` Line 380  This variable defaults to the value of `
380                (tramp-login-args           ("-u" "%u" "-s"                (tramp-login-args           ("-u" "%u" "-s"
381                                             "-p" "Password:"))                                             "-p" "Password:"))
382                (tramp-copy-args            nil)                (tramp-copy-args            nil)
383                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
384                  (tramp-password-end-of-line nil))
385       ("multi" (tramp-connection-function  tramp-open-connection-multi)       ("multi" (tramp-connection-function  tramp-open-connection-multi)
386                (tramp-login-program        nil)                (tramp-login-program        nil)
387                (tramp-copy-program         nil)                (tramp-copy-program         nil)
388                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
389                (tramp-login-args           nil)                (tramp-login-args           nil)
390                (tramp-copy-args            nil)                (tramp-copy-args            nil)
391                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
392                  (tramp-password-end-of-line nil))
393       ("scpx"  (tramp-connection-function  tramp-open-connection-rsh)       ("scpx"  (tramp-connection-function  tramp-open-connection-rsh)
394                (tramp-login-program        "ssh")                (tramp-login-program        "ssh")
395                (tramp-copy-program         "scp")                (tramp-copy-program         "scp")
396                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
397                (tramp-login-args           ("-e" "none" "-t" "-t" "/bin/sh"))                (tramp-login-args           ("-e" "none" "-t" "-t" "/bin/sh"))
398                (tramp-copy-args            nil)                (tramp-copy-args            nil)
399                (tramp-copy-keep-date-arg   "-p"))                (tramp-copy-keep-date-arg   "-p")
400                  (tramp-password-end-of-line nil))
401       ("sshx"  (tramp-connection-function  tramp-open-connection-rsh)       ("sshx"  (tramp-connection-function  tramp-open-connection-rsh)
402                (tramp-login-program        "ssh")                (tramp-login-program        "ssh")
403                (tramp-copy-program         nil)                (tramp-copy-program         nil)
404                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
405                (tramp-login-args           ("-e" "none" "-t" "-t" "/bin/sh"))                (tramp-login-args           ("-e" "none" "-t" "-t" "/bin/sh"))
406                (tramp-copy-args            nil)                (tramp-copy-args            nil)
407                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
408                  (tramp-password-end-of-line nil))
409       ("krlogin"       ("krlogin"
410                (tramp-connection-function  tramp-open-connection-rsh)                (tramp-connection-function  tramp-open-connection-rsh)
411                (tramp-login-program        "krlogin")                (tramp-login-program        "krlogin")
# Line 392  This variable defaults to the value of ` Line 413  This variable defaults to the value of `
413                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
414                (tramp-login-args           ("-x"))                (tramp-login-args           ("-x"))
415                (tramp-copy-args            nil)                (tramp-copy-args            nil)
416                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
417                  (tramp-password-end-of-line nil))
418       ("plink"       ("plink"
419                (tramp-connection-function  tramp-open-connection-rsh)                (tramp-connection-function  tramp-open-connection-rsh)
420                (tramp-login-program        "plink")                (tramp-login-program        "plink")
# Line 400  This variable defaults to the value of ` Line 422  This variable defaults to the value of `
422                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
423                (tramp-login-args           ("-ssh")) ;optionally add "-v"                (tramp-login-args           ("-ssh")) ;optionally add "-v"
424                (tramp-copy-args            nil)                (tramp-copy-args            nil)
425                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
426                  (tramp-password-end-of-line "xy")) ;see docstring for "xy"
427       ("plink1"       ("plink1"
428                (tramp-connection-function  tramp-open-connection-rsh)                (tramp-connection-function  tramp-open-connection-rsh)
429                (tramp-login-program        "plink")                (tramp-login-program        "plink")
# Line 408  This variable defaults to the value of ` Line 431  This variable defaults to the value of `
431                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
432                (tramp-login-args           ("-1" "-ssh")) ;optionally add "-v"                (tramp-login-args           ("-1" "-ssh")) ;optionally add "-v"
433                (tramp-copy-args            nil)                (tramp-copy-args            nil)
434                (tramp-copy-keep-date-arg   nil))                (tramp-copy-keep-date-arg   nil)
435                  (tramp-password-end-of-line "xy")) ;see docstring for "xy"
436       ("pscp"       ("pscp"
437                (tramp-connection-function  tramp-open-connection-rsh)                (tramp-connection-function  tramp-open-connection-rsh)
438                (tramp-login-program        "plink")                (tramp-login-program        "plink")
# Line 416  This variable defaults to the value of ` Line 440  This variable defaults to the value of `
440                (tramp-remote-sh            "/bin/sh")                (tramp-remote-sh            "/bin/sh")
441                (tramp-login-args           ("-ssh"))                (tramp-login-args           ("-ssh"))
442                (tramp-copy-args            nil)                (tramp-copy-args            nil)
443                (tramp-copy-keep-date-arg   "-p"))                (tramp-copy-keep-date-arg   "-p")
444                  (tramp-password-end-of-line "xy")) ;see docstring for "xy"
445       ("fcp"         ("fcp"  
446                (tramp-connection-function  tramp-open-connection-rsh)                (tramp-connection-function  tramp-open-connection-rsh)
447                (tramp-login-program        "fsh")                (tramp-login-program        "fsh")
# Line 424  This variable defaults to the value of ` Line 449  This variable defaults to the value of `
449                (tramp-remote-sh            "/bin/sh -i")                (tramp-remote-sh            "/bin/sh -i")
450                (tramp-login-args           ("sh" "-i"))                (tramp-login-args           ("sh" "-i"))
451                (tramp-copy-args            nil)                (tramp-copy-args            nil)
452                (tramp-copy-keep-date-arg   "-p"))                (tramp-copy-keep-date-arg   "-p")
453                  (tramp-password-end-of-line nil))
454       )       )
455    "*Alist of methods for remote files.    "*Alist of methods for remote files.
456  This is a list of entries of the form (NAME PARAM1 PARAM2 ...).  This is a list of entries of the form (NAME PARAM1 PARAM2 ...).
# Line 469  pair of the form (KEY VALUE).  The follo Line 495  pair of the form (KEY VALUE).  The follo
495      This specifies the parameter to use for the copying program when the      This specifies the parameter to use for the copying program when the
496      timestamp of the original file should be kept.  For `rcp', use `-p', for      timestamp of the original file should be kept.  For `rcp', use `-p', for
497      `rsync', use `-t'.      `rsync', use `-t'.
498      * `tramp-password-end-of-line'
499        This specifies the string to use for terminating the line after
500        submitting the password.  If this method parameter is nil, then the
501        value of the normal variable `tramp-default-password-end-of-line'
502        is used.  This parameter is necessary because the \"plink\" program
503        requires any two characters after sending the password.  These do
504        not have to be newline or carriage return characters.  Other login
505        programs are happy with just one character, the newline character.
506        We use \"xy\" as the value for methods using \"plink\".
507    
508  What does all this mean?  Well, you should specify `tramp-login-program'  What does all this mean?  Well, you should specify `tramp-login-program'
509  for all methods; this program is used to log in to the remote site.  Then,  for all methods; this program is used to log in to the remote site.  Then,
# Line 518  host other than `localhost' or the name Line 553  host other than `localhost' or the name
553                       (list (const tramp-encoding-function)                       (list (const tramp-encoding-function)
554                             (choice (const nil) function))                             (choice (const nil) function))
555                       (list (const tramp-decoding-function)                       (list (const tramp-decoding-function)
556                             (choice (const nil) function))))))                             (choice (const nil) function))
557                         (list (const tramp-password-end-of-line)
558                               (choice (const nil) string))))))
559    
560  (defcustom tramp-multi-methods '("multi" "multiu")  (defcustom tramp-multi-methods '("multi" "multiu")
561    "*List of multi-hop methods.    "*List of multi-hop methods.
# Line 664  the info pages." Line 701  the info pages."
701    "*String used for end of line in rsh connections.    "*String used for end of line in rsh connections.
702  I don't think this ever needs to be changed, so please tell me about it  I don't think this ever needs to be changed, so please tell me about it
703  if you need to change this.  if you need to change this.
704  Also see `tramp-password-end-of-line'."  Also see the method parameter `tramp-password-end-of-line' and the normal
705    variable `tramp-default-password-end-of-line'."
706    :group 'tramp    :group 'tramp
707    :type 'string)    :type 'string)
708    
709  (defcustom tramp-password-end-of-line  (defcustom tramp-default-password-end-of-line
710    (if (string-match "plink" tramp-default-method)    tramp-rsh-end-of-line
       ;; Any two characters will do for plink!  Doesn't have to be  
       ;; newline characters.  
       "xy"  
     tramp-rsh-end-of-line)  
711    "*String used for end of line after sending a password.    "*String used for end of line after sending a password.
712    This variable provides the default value for the method parameter
713    `tramp-password-end-of-line', see `tramp-methods' for more details.
714    
715  It seems that people using plink under Windows need to send  It seems that people using plink under Windows need to send
716  \"\\r\\n\" (carriage-return, then newline) after a password, but just  \"\\r\\n\" (carriage-return, then newline) after a password, but just
717  \"\\n\" after all other lines.  This variable can be used for the  \"\\n\" after all other lines.  This variable can be used for the
# Line 806  This variable is only used when Tramp ne Line 843  This variable is only used when Tramp ne
843  for tilde expansion.  The extra arguments should typically prevent the  for tilde expansion.  The extra arguments should typically prevent the
844  shell from reading its init file."  shell from reading its init file."
845    :group 'tramp    :group 'tramp
846    :type '(alist :key-type string :value-type string))    ;; This might be the wrong way to test whether the widget type
847      ;; `alist' is available.  Who knows the right way to test it?
848      :type (if (get 'alist 'widget-type)
849                '(alist :key-type string :value-type string)
850              '(repeat (cons string string))))
851    
852  (defcustom tramp-prefix-format  (defcustom tramp-prefix-format
853    (if tramp-unified-filenames "/" "/[")    (if tramp-unified-filenames "/" "/[")
# Line 1171  See `tramp-actions-before-shell' for mor Line 1212  See `tramp-actions-before-shell' for mor
1212    :group 'tramp    :group 'tramp
1213    :type '(repeat (list variable function)))    :type '(repeat (list variable function)))
1214    
1215    (defcustom tramp-initial-commands
1216      '("unset correct"
1217        "unset autocorrect")
1218      "List of commands to send to the first remote shell that we see.
1219    These commands will be sent to any shell, and thus they should be
1220    designed to work in such circumstances.  Also, restrict the commands
1221    to the bare necessity for getting the remote shell into a state
1222    where it is possible to execute the Bourne-ish shell.
1223    
1224    At the moment, the command to execute the Bourne-ish shell uses strange
1225    quoting which `tcsh' tries to correct, so we send the command \"unset
1226    autocorrect\" to the remote host."
1227      :group 'tramp
1228      :type '(repeat string))
1229    
1230  ;; Chunked sending kluge.  We set this to 500 for black-listed constellations  ;; Chunked sending kluge.  We set this to 500 for black-listed constellations
1231  ;; known to have a bug in `process-send-string'; some ssh connections appear  ;; known to have a bug in `process-send-string'; some ssh connections appear
1232  ;; to drop bytes when data is sent too quickly.  ;; to drop bytes when data is sent too quickly.
# Line 1290  method parameter, as specified in `tramp Line 1346  method parameter, as specified in `tramp
1346  In the connection buffer, this variable has the value of the like-named  In the connection buffer, this variable has the value of the like-named
1347  method parameter, as specified in `tramp-methods' (which see).")  method parameter, as specified in `tramp-methods' (which see).")
1348    
1349    (defvar tramp-password-end-of-line nil
1350      "This internal variable holds a parameter for `tramp-methods'.
1351    In the connection buffer, this variable has the value of the like-named
1352    method parameter, as specified in `tramp-methods' (which see).")
1353    
1354  ;; CCC `local in each buffer'?  ;; CCC `local in each buffer'?
1355  (defvar tramp-ls-command nil  (defvar tramp-ls-command nil
1356    "This command is used to get a long listing with numeric user and group ids.    "This command is used to get a long listing with numeric user and group ids.
# Line 2896  This will break if COMMAND prints a newl Line 2957  This will break if COMMAND prints a newl
2957          (let (status)          (let (status)
2958            (when (string-match "&[ \t]*\\'" command)            (when (string-match "&[ \t]*\\'" command)
2959              (error "Tramp doesn't grok asynchronous shell commands, yet"))              (error "Tramp doesn't grok asynchronous shell commands, yet"))
2960            (when error-buffer  ;;        (when error-buffer
2961              (error "Tramp doesn't grok optional third arg ERROR-BUFFER, yet"))  ;;          (error "Tramp doesn't grok optional third arg ERROR-BUFFER, yet"))
2962            (save-excursion            (save-excursion
2963              (tramp-barf-unless-okay              (tramp-barf-unless-okay
2964               multi-method method user host               multi-method method user host
# Line 2905  This will break if COMMAND prints a newl Line 2966  This will break if COMMAND prints a newl
2966               nil 'file-error               nil 'file-error
2967               "tramp-handle-shell-command: Couldn't `cd %s'"               "tramp-handle-shell-command: Couldn't `cd %s'"
2968               (tramp-shell-quote-argument localname))               (tramp-shell-quote-argument localname))
2969              (tramp-send-command multi-method method user host              (tramp-send-command
2970                                  (concat command "; tramp_old_status=$?"))               multi-method method user host
2971                 (if error-buffer
2972                     (format "( %s ) 2>/tmp/tramp.$$.err; tramp_old_status=$?"
2973                             command)
2974                   (format "%s ;tramp_old_status=$?" command)))
2975              ;; This will break if the shell command prints "/////"              ;; This will break if the shell command prints "/////"
2976              ;; somewhere.  Let's just hope for the best...              ;; somewhere.  Let's just hope for the best...
2977              (tramp-wait-for-output))              (tramp-wait-for-output))
# Line 2918  This will break if COMMAND prints a newl Line 2983  This will break if COMMAND prints a newl
2983              (setq output-buffer (current-buffer)))              (setq output-buffer (current-buffer)))
2984            (set-buffer output-buffer)            (set-buffer output-buffer)
2985            (insert-buffer (tramp-get-buffer multi-method method user host))            (insert-buffer (tramp-get-buffer multi-method method user host))
2986              (when error-buffer
2987                (save-excursion
2988                  (unless (bufferp error-buffer)
2989                    (setq error-buffer (get-buffer-create error-buffer)))
2990                  (tramp-send-command
2991                   multi-method method user host
2992                   "cat /tmp/tramp.$$.err")
2993                  (tramp-wait-for-output)
2994                  (set-buffer error-buffer)
2995                  (insert-buffer (tramp-get-buffer multi-method method user host))
2996                  (tramp-send-command-and-check
2997                   multi-method method user host "rm -f /tmp/tramp.$$.err")))
2998            (save-excursion            (save-excursion
2999              (tramp-send-command multi-method method user host "cd")              (tramp-send-command multi-method method user host "cd")
3000              (tramp-wait-for-output)              (tramp-wait-for-output)
# Line 3084  This will break if COMMAND prints a newl Line 3161  This will break if COMMAND prints a newl
3161        ;; jka-compr.  By let-binding inhibit-file-name-operation, we        ;; jka-compr.  By let-binding inhibit-file-name-operation, we
3162        ;; propagate that care to the file-local-copy operation.        ;; propagate that care to the file-local-copy operation.
3163        (let ((local-copy        (let ((local-copy
3164               (let ((inhibit-file-name-operation 'file-local-copy))               (let ((inhibit-file-name-operation
3165                        (when (eq inhibit-file-name-operation
3166                                  'insert-file-contents)
3167                          'file-local-copy)))
3168                 (file-local-copy filename)))                 (file-local-copy filename)))
3169              (coding-system-used nil)              (coding-system-used nil)
3170              (result nil))              (result nil))
# Line 4115  hosts, or files, disagree." Line 4195  hosts, or files, disagree."
4195    
4196  (defun tramp-buffer-name (multi-method method user host)  (defun tramp-buffer-name (multi-method method user host)
4197    "A name for the connection buffer for USER at HOST using METHOD."    "A name for the connection buffer for USER at HOST using METHOD."
4198    (cond (multi-method    (if multi-method
4199           (tramp-buffer-name-multi-method "tramp" multi-method method user host))        (tramp-buffer-name-multi-method "tramp" multi-method method user host)
4200          (user      (let ((method (tramp-find-method multi-method method user host)))
4201           (format "*tramp/%s %s@%s*" method user host))        (if user
4202          (t            (format "*tramp/%s %s@%s*" method user host))
4203           (format "*tramp/%s %s*" method host))))        (format "*tramp/%s %s*" method host))))
4204    
4205  (defun tramp-buffer-name-multi-method (prefix multi-method method user host)  (defun tramp-buffer-name-multi-method (prefix multi-method method user host)
4206    "A name for the multi method connection buffer.    "A name for the multi method connection buffer.
# Line 4150  USER the array of user names, HOST the a Line 4230  USER the array of user names, HOST the a
4230    
4231  (defun tramp-debug-buffer-name (multi-method method user host)  (defun tramp-debug-buffer-name (multi-method method user host)
4232    "A name for the debug buffer for USER at HOST using METHOD."    "A name for the debug buffer for USER at HOST using METHOD."
4233    (cond (multi-method    (if multi-method
4234           (tramp-buffer-name-multi-method "debug tramp"        (tramp-buffer-name-multi-method "debug tramp"
4235                                           multi-method method user host))                                        multi-method method user host)
4236          (user      (let ((method (tramp-find-method multi-method method user host)))
4237           (format "*debug tramp/%s %s@%s*" method user host))        (if user
4238          (t            (format "*debug tramp/%s %s@%s*" method user host)
4239           (format "*debug tramp/%s %s*" method host))))          (format "*debug tramp/%s %s*" method host)))))
4240    
4241  (defun tramp-get-debug-buffer (multi-method method user host)  (defun tramp-get-debug-buffer (multi-method method user host)
4242    "Get the debug buffer for USER at HOST using METHOD."    "Get the debug buffer for USER at HOST using METHOD."
# Line 4540  The terminal type can be configured with Line 4620  The terminal type can be configured with
4620      (unless (eq exit 'ok)      (unless (eq exit 'ok)
4621        (error "Login failed"))))        (error "Login failed"))))
4622    
4623    ;; Functions to execute when we have seen the remote shell prompt but
4624    ;; before we exec the Bourne-ish shell.  Note that these commands
4625    ;; might be sent to any shell, not just a Bourne-ish shell.  This
4626    ;; means that the commands need to work in all shells.  (It is also
4627    ;; okay for some commands to just fail with an error message, but
4628    ;; please make sure that they at least don't crash the odd shell people
4629    ;; might be running...)
4630    (defun tramp-process-initial-commands (p
4631                                           multi-method method user host
4632                                           commands)
4633      "Send list of commands to remote host, in order."
4634      (let (cmd)
4635        (while commands
4636          (setq cmd (pop commands))
4637          (erase-buffer)
4638          (tramp-message 10 "Sending command to remote shell: %s"
4639                         cmd)
4640          (tramp-send-command multi-method method user host cmd)
4641          (tramp-barf-if-no-shell-prompt
4642           p 60 "Remote shell command failed: %s" cmd))
4643        (erase-buffer)))
4644    
4645  ;; The actual functions for opening connections.  ;; The actual functions for opening connections.
4646    
4647  (defun tramp-open-connection-telnet (multi-method method user host)  (defun tramp-open-connection-telnet (multi-method method user host)
# Line 4950  seconds.  If not, it produces an error m Line 5052  seconds.  If not, it produces an error m
5052  Uses PROMPT as a prompt and sends the password to process P."  Uses PROMPT as a prompt and sends the password to process P."
5053    (let ((pw (tramp-read-passwd prompt)))    (let ((pw (tramp-read-passwd prompt)))
5054      (erase-buffer)      (erase-buffer)
5055      (process-send-string p (concat pw tramp-password-end-of-line))))      (process-send-string
5056         p (concat pw
5057                   (tramp-get-password-end-of-line
5058                    tramp-current-multi-method
5059                    tramp-current-method
5060                    tramp-current-user
5061                    tramp-current-host)))))
5062    
5063  ;; HHH: Not Changed.  This might handle the case where USER is not  ;; HHH: Not Changed.  This might handle the case where USER is not
5064  ;;      given in the "File name" very poorly.  Then, the local  ;;      given in the "File name" very poorly.  Then, the local
# Line 4976  to set up.  METHOD, USER and HOST specif Line 5084  to set up.  METHOD, USER and HOST specif
5084    ;; a Kerberos login.    ;; a Kerberos login.
5085    (sit-for 1)    (sit-for 1)
5086    (tramp-discard-garbage-erase-buffer p multi-method method user host)    (tramp-discard-garbage-erase-buffer p multi-method method user host)
5087      (tramp-process-initial-commands p multi-method method user host
5088                                      tramp-initial-commands)
5089    ;; It is useful to set the prompt in the following command because    ;; It is useful to set the prompt in the following command because
5090    ;; some people have a setting for $PS1 which /bin/sh doesn't know    ;; some people have a setting for $PS1 which /bin/sh doesn't know
5091    ;; about and thus /bin/sh will display a strange prompt.  For    ;; about and thus /bin/sh will display a strange prompt.  For
# Line 5035  to set up.  METHOD, USER and HOST specif Line 5145  to set up.  METHOD, USER and HOST specif
5145          ;; We have found a ^M but cannot frob the process coding system          ;; We have found a ^M but cannot frob the process coding system
5146          ;; because we're running on a non-MULE Emacs.  Let's try          ;; because we're running on a non-MULE Emacs.  Let's try
5147          ;; stty, instead.          ;; stty, instead.
5148            (erase-buffer)
5149          (tramp-message 9 "Trying `stty -onlcr'")          (tramp-message 9 "Trying `stty -onlcr'")
5150          (tramp-send-command-internal multi-method method user host          (tramp-send-command-internal multi-method method user host
5151                                       "stty -onlcr"))))                                       "stty -onlcr"))))
# Line 6057  If the value is not set for the connecti Line 6168  If the value is not set for the connecti
6168                (error "Method `%s' didn't specify `keep-date' arg for tramp"                (error "Method `%s' didn't specify `keep-date' arg for tramp"
6169                       (or multi-method method)))))                       (or multi-method method)))))
6170    
6171    (defun tramp-get-password-end-of-line (multi-method method user host)
6172      (let ((entry (assoc 'tramp-password-end-of-line
6173                          (assoc (tramp-find-method multi-method method user host)
6174                                 tramp-methods))))
6175        (unless entry
6176          (error "Method `%s' didn't specify `password-end-of-line' arg for tramp"
6177                 (or multi-method method)))
6178        (or (second entry) tramp-default-password-end-of-line)))
6179    
6180  ;; Auto saving to a special directory.  ;; Auto saving to a special directory.
6181    
6182  (defun tramp-make-auto-save-file-name (fn)  (defun tramp-make-auto-save-file-name (fn)
# Line 6322  Only works for Bourne-like shells." Line 6442  Only works for Bourne-like shells."
6442         tramp-auto-save-directory        ; vars to dump         tramp-auto-save-directory        ; vars to dump
6443         tramp-default-method         tramp-default-method
6444         tramp-rsh-end-of-line         tramp-rsh-end-of-line
6445         tramp-password-end-of-line         tramp-default-password-end-of-line
6446         tramp-remote-path         tramp-remote-path
6447         tramp-login-prompt-regexp         tramp-login-prompt-regexp
6448         tramp-password-prompt-regexp         tramp-password-prompt-regexp

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

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