Patrick Monnerat and I modified libcurl so that now it *copies* all strings
passed to it with curl_easy_setopt()! Previously it has always just refered to the data, forcing the user to keep the data around until libcurl is done with it. That is now history and libcurl will instead clone the given strings and keep private copies.
This commit is contained in:
10
lib/ssh.c
10
lib/ssh.c
@@ -422,8 +422,8 @@ static CURLcode ssh_statemach_act(struct connectdata *conn)
|
||||
HOME environment variable etc? */
|
||||
home = curl_getenv("HOME");
|
||||
|
||||
if (data->set.ssh_public_key)
|
||||
sshc->rsa_pub = aprintf("%s", data->set.ssh_public_key);
|
||||
if (data->set.str[STRING_SSH_PUBLIC_KEY])
|
||||
sshc->rsa_pub = aprintf("%s", data->set.str[STRING_SSH_PUBLIC_KEY]);
|
||||
else if (home)
|
||||
sshc->rsa_pub = aprintf("%s/.ssh/id_dsa.pub", home);
|
||||
|
||||
@@ -435,8 +435,8 @@ static CURLcode ssh_statemach_act(struct connectdata *conn)
|
||||
break;
|
||||
}
|
||||
|
||||
if (data->set.ssh_private_key)
|
||||
sshc->rsa = aprintf("%s", data->set.ssh_private_key);
|
||||
if (data->set.str[STRING_SSH_PRIVATE_KEY])
|
||||
sshc->rsa = aprintf("%s", data->set.str[STRING_SSH_PRIVATE_KEY]);
|
||||
else if (home)
|
||||
sshc->rsa = aprintf("%s/.ssh/id_dsa", home);
|
||||
|
||||
@@ -450,7 +450,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn)
|
||||
break;
|
||||
}
|
||||
|
||||
sshc->passphrase = data->set.key_passwd;
|
||||
sshc->passphrase = data->set.str[STRING_KEY_PASSWD];
|
||||
if (!sshc->passphrase)
|
||||
sshc->passphrase = "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user