[vlc-commits] sftp: don't ask for user if already provided
Thomas Guillem
git at videolan.org
Tue Oct 31 11:03:21 CET 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Oct 31 10:06:42 2017 +0100| [0c251bea6b5e632a405c1cb0954d16b4700e112a] | committer: Thomas Guillem
sftp: don't ask for user if already provided
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0c251bea6b5e632a405c1cb0954d16b4700e112a
---
modules/access/sftp.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/access/sftp.c b/modules/access/sftp.c
index 42a321c18c..6f3721602f 100644
--- a/modules/access/sftp.c
+++ b/modules/access/sftp.c
@@ -306,6 +306,8 @@ static int Open( vlc_object_t* p_this )
goto error;
}
+ vlc_credential_get( &credential, p_access, "sftp-user", "sftp-pwd",
+ NULL, NULL );
char* psz_userauthlist = NULL;
do
{
@@ -324,8 +326,10 @@ static int Open( vlc_object_t* p_this )
( AuthKeyAgent( p_access, credential.psz_username ) == VLC_SUCCESS ||
AuthPublicKey( p_access, psz_home, credential.psz_username ) == VLC_SUCCESS ) )
break;
- if( strstr( psz_userauthlist, "password" ) != NULL &&
- libssh2_userauth_password( p_sys->ssh_session,
+
+ if( strstr( psz_userauthlist, "password" ) != NULL
+ && credential.psz_password != NULL
+ && libssh2_userauth_password( p_sys->ssh_session,
credential.psz_username,
credential.psz_password ) == 0 )
{
More information about the vlc-commits
mailing list