[vlc-devel] [PATCH 6/6] dsm: init password in get_credentials
Thomas Guillem
thomas at gllm.fr
Wed May 20 19:21:58 CEST 2015
---
modules/access/dsm/access.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/modules/access/dsm/access.c b/modules/access/dsm/access.c
index 26a3754..6f27c17 100644
--- a/modules/access/dsm/access.c
+++ b/modules/access/dsm/access.c
@@ -273,7 +273,11 @@ static void get_credentials( access_t *p_access )
/* Fetch credentials, either from URI or from options if not provided */
if( p_sys->url.psz_password == NULL )
+ {
p_sys->creds.password = var_InheritString( p_access, "smb-pwd" );
+ if( p_sys->url.psz_password == NULL )
+ p_sys->creds.password = strdup( "Guest" );
+ }
else
p_sys->creds.password = strdup( p_sys->url.psz_password );
@@ -409,11 +413,6 @@ static int login( access_t *p_access )
{
access_sys_t *p_sys = p_access->p_sys;
- if( p_sys->creds.login == NULL )
- p_sys->creds.login = strdup( "Guest" );
- if( p_sys->creds.password == NULL )
- p_sys->creds.password = strdup( "Guest" );
-
/* Try to authenticate on the remote machine */
if( smb_connect( p_access ) != VLC_SUCCESS )
{
--
2.1.4
More information about the vlc-devel
mailing list