mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
virNetSSHSessionAuthAddPrivKeyAuth: Remove unused 'password' argument
The only caller doesn't pass the password. Remove the argument. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
eb21551e21
commit
7f6b632b73
@ -954,8 +954,7 @@ virNetSocketNewConnectLibSSH2(const char *host,
|
|||||||
} else if (STRCASEEQ(authMethod, "privkey")) {
|
} else if (STRCASEEQ(authMethod, "privkey")) {
|
||||||
ret = virNetSSHSessionAuthAddPrivKeyAuth(sess,
|
ret = virNetSSHSessionAuthAddPrivKeyAuth(sess,
|
||||||
username,
|
username,
|
||||||
privkey,
|
privkey);
|
||||||
NULL);
|
|
||||||
} else if (STRCASEEQ(authMethod, "agent")) {
|
} else if (STRCASEEQ(authMethod, "agent")) {
|
||||||
ret = virNetSSHSessionAuthAddAgentAuth(sess, username);
|
ret = virNetSSHSessionAuthAddAgentAuth(sess, username);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1056,13 +1056,11 @@ virNetSSHSessionAuthAddAgentAuth(virNetSSHSession *sess,
|
|||||||
int
|
int
|
||||||
virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSession *sess,
|
virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSession *sess,
|
||||||
const char *username,
|
const char *username,
|
||||||
const char *keyfile,
|
const char *keyfile)
|
||||||
const char *password)
|
|
||||||
{
|
{
|
||||||
virNetSSHAuthMethod *auth;
|
virNetSSHAuthMethod *auth;
|
||||||
|
|
||||||
char *user = NULL;
|
char *user = NULL;
|
||||||
char *pass = NULL;
|
|
||||||
char *file = NULL;
|
char *file = NULL;
|
||||||
|
|
||||||
if (!username || !keyfile) {
|
if (!username || !keyfile) {
|
||||||
@ -1076,13 +1074,11 @@ virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSession *sess,
|
|||||||
|
|
||||||
user = g_strdup(username);
|
user = g_strdup(username);
|
||||||
file = g_strdup(keyfile);
|
file = g_strdup(keyfile);
|
||||||
pass = g_strdup(password);
|
|
||||||
|
|
||||||
if (!(auth = virNetSSHSessionAuthMethodNew(sess)))
|
if (!(auth = virNetSSHSessionAuthMethodNew(sess)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
auth->username = user;
|
auth->username = user;
|
||||||
auth->password = pass;
|
|
||||||
auth->filename = file;
|
auth->filename = file;
|
||||||
auth->method = VIR_NET_SSH_AUTH_PRIVKEY;
|
auth->method = VIR_NET_SSH_AUTH_PRIVKEY;
|
||||||
|
|
||||||
@ -1091,7 +1087,6 @@ virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSession *sess,
|
|||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(user);
|
VIR_FREE(user);
|
||||||
VIR_FREE(pass);
|
|
||||||
VIR_FREE(file);
|
VIR_FREE(file);
|
||||||
virObjectUnlock(sess);
|
virObjectUnlock(sess);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -56,8 +56,7 @@ int virNetSSHSessionAuthAddAgentAuth(virNetSSHSession *sess,
|
|||||||
|
|
||||||
int virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSession *sess,
|
int virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSession *sess,
|
||||||
const char *username,
|
const char *username,
|
||||||
const char *keyfile,
|
const char *keyfile);
|
||||||
const char *password);
|
|
||||||
|
|
||||||
int virNetSSHSessionAuthAddKeyboardAuth(virNetSSHSession *sess,
|
int virNetSSHSessionAuthAddKeyboardAuth(virNetSSHSession *sess,
|
||||||
const char *username,
|
const char *username,
|
||||||
|
Loading…
Reference in New Issue
Block a user