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

Diff for /src/usr.bin/ssh/sshconnect.c between version 1.5 and 1.6

version 1.5, 1999/09/29 18:16:21 version 1.6, 1999/09/29 21:14:16
Line 45 
Line 45 
   char portstring[100];    char portstring[100];
   
   /* Convert the port number into a string. */    /* Convert the port number into a string. */
   sprintf(portstring, "%d", port);    snprintf(portstring, sizeof portstring, "%d", port);
   
   /* Build the final command string in the buffer by making the appropriate    /* Build the final command string in the buffer by making the appropriate
      substitutions to the given proxy command. */       substitutions to the given proxy command. */
Line 545 
Line 545 
          this work even if stdin has been redirected.  If running in           this work even if stdin has been redirected.  If running in
          batch mode, we just use the empty passphrase, which will fail and           batch mode, we just use the empty passphrase, which will fail and
          return. */           return. */
       sprintf(buf, "Enter passphrase for RSA key '%.100s': ", comment);        snprintf(buf, sizeof buf,
           "Enter passphrase for RSA key '%.100s': ", comment);
       if (may_ask_passphrase)        if (may_ask_passphrase)
         passphrase = read_passphrase(buf, 0);          passphrase = read_passphrase(buf, 0);
       else        else
Line 857 
Line 858 
     server_cell = p;      server_cell = p;
   
     /* Flesh out our credentials. */      /* Flesh out our credentials. */
     strcpy(creds.service, "afs");      strlcpy(creds.service, "afs", sizeof creds.service);
     creds.instance[0] = '\0';      creds.instance[0] = '\0';
     strncpy(creds.realm, server_cell, REALM_SZ);      strlcpy(creds.realm, server_cell, REALM_SZ);
     memcpy(creds.session, ct.HandShakeKey, DES_KEY_SZ);      memcpy(creds.session, ct.HandShakeKey, DES_KEY_SZ);
     creds.issue_date = ct.BeginTimestamp;      creds.issue_date = ct.BeginTimestamp;
     creds.lifetime = krb_time_to_life(creds.issue_date, ct.EndTimestamp);      creds.lifetime = krb_time_to_life(creds.issue_date, ct.EndTimestamp);
Line 934 
Line 935 
     fatal("Remote machine has too old SSH software version.");      fatal("Remote machine has too old SSH software version.");
   
   /* Send our own protocol version identification. */    /* Send our own protocol version identification. */
   sprintf(buf, "SSH-%d.%d-%.100s\n",    snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n",
           PROTOCOL_MAJOR, PROTOCOL_MINOR, SSH_VERSION);            PROTOCOL_MAJOR, PROTOCOL_MINOR, SSH_VERSION);
   if (write(connection_out, buf, strlen(buf)) != strlen(buf))    if (write(connection_out, buf, strlen(buf)) != strlen(buf))
     fatal("write: %.100s", strerror(errno));      fatal("write: %.100s", strerror(errno));
Line 965 
Line 966 
         {          {
           /* Print a newline (the prompt probably didn\'t have one). */            /* Print a newline (the prompt probably didn\'t have one). */
           fprintf(stderr, "\n");            fprintf(stderr, "\n");
           strcpy(buf, "no");            strlcpy(buf, "no", sizeof buf);
         }          }
       /* Remove newline from response. */        /* Remove newline from response. */
       if (strchr(buf, '\n'))        if (strchr(buf, '\n'))

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6