version 1.377, 2013/04/19 11:10:18 |
version 1.378, 2013/05/17 00:13:14 |
|
|
|
|
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; |
} |
} |
} |
} |
|
|
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, "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; |
|
|
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, |
|
|
"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 */ |
|
|
|
|
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"); |
|
|
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; |
|
|
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) |
|
|
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], |
|
|
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; |
|
|
|
|
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; |
|
|
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 |