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")) {
|
||||
ret = virNetSSHSessionAuthAddPrivKeyAuth(sess,
|
||||
username,
|
||||
privkey,
|
||||
NULL);
|
||||
privkey);
|
||||
} else if (STRCASEEQ(authMethod, "agent")) {
|
||||
ret = virNetSSHSessionAuthAddAgentAuth(sess, username);
|
||||
} else {
|
||||
|
@ -1056,13 +1056,11 @@ virNetSSHSessionAuthAddAgentAuth(virNetSSHSession *sess,
|
||||
int
|
||||
virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSession *sess,
|
||||
const char *username,
|
||||
const char *keyfile,
|
||||
const char *password)
|
||||
const char *keyfile)
|
||||
{
|
||||
virNetSSHAuthMethod *auth;
|
||||
|
||||
char *user = NULL;
|
||||
char *pass = NULL;
|
||||
char *file = NULL;
|
||||
|
||||
if (!username || !keyfile) {
|
||||
@ -1076,13 +1074,11 @@ virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSession *sess,
|
||||
|
||||
user = g_strdup(username);
|
||||
file = g_strdup(keyfile);
|
||||
pass = g_strdup(password);
|
||||
|
||||
if (!(auth = virNetSSHSessionAuthMethodNew(sess)))
|
||||
goto error;
|
||||
|
||||
auth->username = user;
|
||||
auth->password = pass;
|
||||
auth->filename = file;
|
||||
auth->method = VIR_NET_SSH_AUTH_PRIVKEY;
|
||||
|
||||
@ -1091,7 +1087,6 @@ virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSession *sess,
|
||||
|
||||
error:
|
||||
VIR_FREE(user);
|
||||
VIR_FREE(pass);
|
||||
VIR_FREE(file);
|
||||
virObjectUnlock(sess);
|
||||
return -1;
|
||||
|
@ -56,8 +56,7 @@ int virNetSSHSessionAuthAddAgentAuth(virNetSSHSession *sess,
|
||||
|
||||
int virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSession *sess,
|
||||
const char *username,
|
||||
const char *keyfile,
|
||||
const char *password);
|
||||
const char *keyfile);
|
||||
|
||||
int virNetSSHSessionAuthAddKeyboardAuth(virNetSSHSession *sess,
|
||||
const char *username,
|
||||
|
Loading…
Reference in New Issue
Block a user