[BACK]Return to scp.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/scp.c between version 1.33 and 1.34

version 1.33, 2000/07/13 23:19:31 version 1.34, 2000/08/19 02:26:08
Line 103 
Line 103 
 /* This is the port to use in contacting the remote site (is non-NULL). */  /* This is the port to use in contacting the remote site (is non-NULL). */
 char *port = NULL;  char *port = NULL;
   
   /* This is the program to execute for the secured connection. ("ssh" or -S) */
   char *ssh_program = SSH_PROGRAM;
   
 /*  /*
  * This function executes the given command as the specified user on the   * This function executes the given command as the specified user on the
  * given host.  This returns < 0 if execution fails, and >= 0 otherwise. This   * given host.  This returns < 0 if execution fails, and >= 0 otherwise. This
Line 148 
Line 151 
                 close(pout[1]);                  close(pout[1]);
   
                 i = 0;                  i = 0;
                 args[i++] = SSH_PROGRAM;                  args[i++] = ssh_program;
                 args[i++] = "-x";                  args[i++] = "-x";
                 args[i++] = "-oFallBackToRsh no";                  args[i++] = "-oFallBackToRsh no";
                 if (IPv4)                  if (IPv4)
Line 181 
Line 184 
                 args[i++] = cmd;                  args[i++] = cmd;
                 args[i++] = NULL;                  args[i++] = NULL;
   
                 execvp(SSH_PROGRAM, args);                  execvp(ssh_program, args);
                 perror(SSH_PROGRAM);                  perror(ssh_program);
                 exit(1);                  exit(1);
         }          }
         /* Parent.  Close the other side, and return the local side. */          /* Parent.  Close the other side, and return the local side. */
Line 252 
Line 255 
         extern int optind;          extern int optind;
   
         fflag = tflag = 0;          fflag = tflag = 0;
         while ((ch = getopt(argc, argv, "dfprtvBCc:i:P:q46")) != EOF)          while ((ch = getopt(argc, argv, "dfprtvBCc:i:P:q46S")) != EOF)
                 switch (ch) {                  switch (ch) {
                 /* User-visible flags. */                  /* User-visible flags. */
                 case '4':                  case '4':
Line 270 
Line 273 
                 case 'r':                  case 'r':
                         iamrecursive = 1;                          iamrecursive = 1;
                         break;                          break;
                   case 'S':
                           ssh_program = optarg;
                           break;
   
                 /* Server options. */                  /* Server options. */
                 case 'd':                  case 'd':
                         targetshouldbedirectory = 1;                          targetshouldbedirectory = 1;
Line 393 
Line 400 
                         if (*src == 0)                          if (*src == 0)
                                 src = ".";                                  src = ".";
                         host = strchr(argv[i], '@');                          host = strchr(argv[i], '@');
                         len = strlen(SSH_PROGRAM) + strlen(argv[i]) +                          len = strlen(ssh_program) + strlen(argv[i]) +
                                 strlen(src) + (tuser ? strlen(tuser) : 0) +                                  strlen(src) + (tuser ? strlen(tuser) : 0) +
                                 strlen(thost) + strlen(targ) + CMDNEEDS + 32;                                  strlen(thost) + strlen(targ) + CMDNEEDS + 32;
                         bp = xmalloc(len);                          bp = xmalloc(len);
Line 406 
Line 413 
                                 else if (!okname(suser))                                  else if (!okname(suser))
                                         continue;                                          continue;
                                 (void) sprintf(bp,                                  (void) sprintf(bp,
                                                "%s%s -x -o'FallBackToRsh no' -n -l %s %s %s %s '%s%s%s:%s'",                                      "%s%s -x -o'FallBackToRsh no' -n -l %s %s %s %s '%s%s%s:%s'",
                                                SSH_PROGRAM, verbose_mode ? " -v" : "",                                       ssh_program, verbose_mode ? " -v" : "",
                                                suser, host, cmd, src,                                       suser, host, cmd, src,
                                                tuser ? tuser : "", tuser ? "@" : "",                                       tuser ? tuser : "", tuser ? "@" : "",
                                                thost, targ);                                       thost, targ);
                         } else {                          } else {
                                 host = cleanhostname(argv[i]);                                  host = cleanhostname(argv[i]);
                                 (void) sprintf(bp,                                  (void) sprintf(bp,
                                                "exec %s%s -x -o'FallBackToRsh no' -n %s %s %s '%s%s%s:%s'",                                      "exec %s%s -x -o'FallBackToRsh no' -n %s %s %s '%s%s%s:%s'",
                                                SSH_PROGRAM, verbose_mode ? " -v" : "",                                       ssh_program, verbose_mode ? " -v" : "",
                                                host, cmd, src,                                       host, cmd, src,
                                                tuser ? tuser : "", tuser ? "@" : "",                                       tuser ? tuser : "", tuser ? "@" : "",
                                                thost, targ);                                       thost, targ);
                         }                          }
                         if (verbose_mode)                          if (verbose_mode)
                                 fprintf(stderr, "Executing: %s\n", bp);                                  fprintf(stderr, "Executing: %s\n", bp);
Line 946 
Line 953 
 void  void
 usage()  usage()
 {  {
         (void) fprintf(stderr,          (void) fprintf(stderr, "usage: scp "
                        "usage: scp [-pqrvC46] [-P port] [-c cipher] [-i identity] f1 f2; or:\n       scp [options] f1 ... fn directory\n");              "[-pqrvC46] [-S ssh] [-P port] [-c cipher] [-i identity] f1 f2; or:\n"
               "       scp [options] f1 ... fn directory\n");
         exit(1);          exit(1);
 }  }
   

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34