[vlc-commits] ftp: fix credentials regression
Thomas Guillem
git at videolan.org
Tue Feb 6 19:31:43 CET 2018
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Feb 6 19:29:04 2018 +0100| [8360f356d3999056a9c46ce6236bb3a8cf9d8938] | committer: Thomas Guillem
ftp: fix credentials regression
Normal user credentials could not be found since the "anonymous" never matched
in keystore.
This is a partial revert of 9366465979633a6df435bc21fb50a7cfb0ff1001
Since we now log anonymous per default. A proper fix need a vlc_credential
change that we won't do now.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8360f356d3999056a9c46ce6236bb3a8cf9d8938
---
modules/access/ftp.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/modules/access/ftp.c b/modules/access/ftp.c
index 5e7b15fb12..a5ad4ddabd 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -456,19 +456,15 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys, const char *path
NULL, NULL );
do
{
- if( credential.psz_username != NULL )
- {
- if( LoginUserPwd( p_access, p_sys, credential.psz_username,
- credential.psz_password, &b_logged ) != 0
- || b_logged )
- break;
- }
- else
- {
- /* No crendential specified: show the dialog with a "anonymous"
- * user pre-filled */
- credential.psz_username = "anonymous";
- }
+ const char *psz_username = credential.psz_username;
+
+ if( psz_username == NULL ) /* use anonymous by default */
+ psz_username = "anonymous";
+
+ if( LoginUserPwd( p_access, p_sys, psz_username,
+ credential.psz_password, &b_logged ) != 0
+ || b_logged )
+ break;
}
while( vlc_credential_get( &credential, p_access, "ftp-user", "ftp-pwd",
LOGIN_DIALOG_TITLE, LOGIN_DIALOG_TEXT,
More information about the vlc-commits
mailing list