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

Diff for /src/usr.bin/ssh/ssh.c between version 1.377 and 1.378

version 1.377, 2013/04/19 11:10:18 version 1.378, 2013/05/17 00:13:14
Line 213 
Line 213 
   
         for (i = 0; i < num_paths; i++) {          for (i = 0; i < num_paths; i++) {
                 cp = tilde_expand_filename(paths[i], original_real_uid);                  cp = tilde_expand_filename(paths[i], original_real_uid);
                 xfree(paths[i]);                  free(paths[i]);
                 paths[i] = cp;                  paths[i] = cp;
         }          }
 }  }
Line 444 
Line 444 
                         if (parse_forward(&fwd, optarg, 1, 0)) {                          if (parse_forward(&fwd, optarg, 1, 0)) {
                                 stdio_forward_host = fwd.listen_host;                                  stdio_forward_host = fwd.listen_host;
                                 stdio_forward_port = fwd.listen_port;                                  stdio_forward_port = fwd.listen_port;
                                 xfree(fwd.connect_host);                                  free(fwd.connect_host);
                         } else {                          } else {
                                 fprintf(stderr,                                  fprintf(stderr,
                                     "Bad stdio forwarding specification '%s'\n",                                      "Bad stdio forwarding specification '%s'\n",
Line 572 
Line 572 
                             line, "command-line", 0, &dummy, SSHCONF_USERCONF)                              line, "command-line", 0, &dummy, SSHCONF_USERCONF)
                             != 0)                              != 0)
                                 exit(255);                                  exit(255);
                         xfree(line);                          free(line);
                         break;                          break;
                 case 's':                  case 's':
                         subsystem_flag = 1;                          subsystem_flag = 1;
Line 659 
Line 659 
                 fatal("Can't specify both -y and -E");                  fatal("Can't specify both -y and -E");
         if (logfile != NULL) {          if (logfile != NULL) {
                 log_redirect_stderr_to(logfile);                  log_redirect_stderr_to(logfile);
                 xfree(logfile);                  free(logfile);
         }          }
         log_init(argv0,          log_init(argv0,
             options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level,              options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level,
Line 747 
Line 747 
                     "p", portstr, "u", pw->pw_name, "L", shorthost,                      "p", portstr, "u", pw->pw_name, "L", shorthost,
                     (char *)NULL);                      (char *)NULL);
                 debug3("expanded LocalCommand: %s", options.local_command);                  debug3("expanded LocalCommand: %s", options.local_command);
                 xfree(cp);                  free(cp);
         }          }
   
         /* force lowercase for hostkey matching */          /* force lowercase for hostkey matching */
Line 759 
Line 759 
   
         if (options.proxy_command != NULL &&          if (options.proxy_command != NULL &&
             strcmp(options.proxy_command, "none") == 0) {              strcmp(options.proxy_command, "none") == 0) {
                 xfree(options.proxy_command);                  free(options.proxy_command);
                 options.proxy_command = NULL;                  options.proxy_command = NULL;
         }          }
         if (options.control_path != NULL &&          if (options.control_path != NULL &&
             strcmp(options.control_path, "none") == 0) {              strcmp(options.control_path, "none") == 0) {
                 xfree(options.control_path);                  free(options.control_path);
                 options.control_path = NULL;                  options.control_path = NULL;
         }          }
   
         if (options.control_path != NULL) {          if (options.control_path != NULL) {
                 cp = tilde_expand_filename(options.control_path,                  cp = tilde_expand_filename(options.control_path,
                     original_real_uid);                      original_real_uid);
                 xfree(options.control_path);                  free(options.control_path);
                 options.control_path = percent_expand(cp, "h", host,                  options.control_path = percent_expand(cp, "h", host,
                     "l", thishost, "n", host_arg, "r", options.user,                      "l", thishost, "n", host_arg, "r", options.user,
                     "p", portstr, "u", pw->pw_name, "L", shorthost,                      "p", portstr, "u", pw->pw_name, "L", shorthost,
                     (char *)NULL);                      (char *)NULL);
                 xfree(cp);                  free(cp);
         }          }
         if (muxclient_command != 0 && options.control_path == NULL)          if (muxclient_command != 0 && options.control_path == NULL)
                 fatal("No ControlPath specified for \"-O\" command");                  fatal("No ControlPath specified for \"-O\" command");
Line 907 
Line 907 
                                 sensitive_data.keys[i] = NULL;                                  sensitive_data.keys[i] = NULL;
                         }                          }
                 }                  }
                 xfree(sensitive_data.keys);                  free(sensitive_data.keys);
         }          }
         for (i = 0; i < options.num_identity_files; i++) {          for (i = 0; i < options.num_identity_files; i++) {
                 if (options.identity_files[i]) {                  free(options.identity_files[i]);
                         xfree(options.identity_files[i]);                  options.identity_files[i] = NULL;
                         options.identity_files[i] = NULL;  
                 }  
                 if (options.identity_keys[i]) {                  if (options.identity_keys[i]) {
                         key_free(options.identity_keys[i]);                          key_free(options.identity_keys[i]);
                         options.identity_keys[i] = NULL;                          options.identity_keys[i] = NULL;
Line 1503 
Line 1501 
                             xstrdup(options.pkcs11_provider); /* XXX */                              xstrdup(options.pkcs11_provider); /* XXX */
                         n_ids++;                          n_ids++;
                 }                  }
                 xfree(keys);                  free(keys);
         }          }
 #endif /* ENABLE_PKCS11 */  #endif /* ENABLE_PKCS11 */
         if ((pw = getpwuid(original_real_uid)) == NULL)          if ((pw = getpwuid(original_real_uid)) == NULL)
Line 1516 
Line 1514 
         for (i = 0; i < options.num_identity_files; i++) {          for (i = 0; i < options.num_identity_files; i++) {
                 if (n_ids >= SSH_MAX_IDENTITY_FILES ||                  if (n_ids >= SSH_MAX_IDENTITY_FILES ||
                     strcasecmp(options.identity_files[i], "none") == 0) {                      strcasecmp(options.identity_files[i], "none") == 0) {
                         xfree(options.identity_files[i]);                          free(options.identity_files[i]);
                         continue;                          continue;
                 }                  }
                 cp = tilde_expand_filename(options.identity_files[i],                  cp = tilde_expand_filename(options.identity_files[i],
Line 1524 
Line 1522 
                 filename = percent_expand(cp, "d", pwdir,                  filename = percent_expand(cp, "d", pwdir,
                     "u", pwname, "l", thishost, "h", host,                      "u", pwname, "l", thishost, "h", host,
                     "r", options.user, (char *)NULL);                      "r", options.user, (char *)NULL);
                 xfree(cp);                  free(cp);
                 public = key_load_public(filename, NULL);                  public = key_load_public(filename, NULL);
                 debug("identity file %s type %d", filename,                  debug("identity file %s type %d", filename,
                     public ? public->type : -1);                      public ? public->type : -1);
                 xfree(options.identity_files[i]);                  free(options.identity_files[i]);
                 identity_files[n_ids] = filename;                  identity_files[n_ids] = filename;
                 identity_keys[n_ids] = public;                  identity_keys[n_ids] = public;
   
Line 1541 
Line 1539 
                 debug("identity file %s type %d", cp,                  debug("identity file %s type %d", cp,
                     public ? public->type : -1);                      public ? public->type : -1);
                 if (public == NULL) {                  if (public == NULL) {
                         xfree(cp);                          free(cp);
                         continue;                          continue;
                 }                  }
                 if (!key_is_cert(public)) {                  if (!key_is_cert(public)) {
                         debug("%s: key %s type %s is not a certificate",                          debug("%s: key %s type %s is not a certificate",
                             __func__, cp, key_type(public));                              __func__, cp, key_type(public));
                         key_free(public);                          key_free(public);
                         xfree(cp);                          free(cp);
                         continue;                          continue;
                 }                  }
                 identity_keys[n_ids] = public;                  identity_keys[n_ids] = public;
Line 1561 
Line 1559 
         memcpy(options.identity_keys, identity_keys, sizeof(identity_keys));          memcpy(options.identity_keys, identity_keys, sizeof(identity_keys));
   
         bzero(pwname, strlen(pwname));          bzero(pwname, strlen(pwname));
         xfree(pwname);          free(pwname);
         bzero(pwdir, strlen(pwdir));          bzero(pwdir, strlen(pwdir));
         xfree(pwdir);          free(pwdir);
 }  }
   
 static void  static void

Legend:
Removed from v.1.377  
changed lines
  Added in v.1.378