[vlc-commits] dsm: don't store credentials in sub items options

Thomas Guillem git at videolan.org
Fri Feb 26 10:59:18 CET 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Feb 17 14:43:44 2016 +0100| [68f4193ca3d18251f774a281c9f0f6d917941f6e] | committer: Thomas Guillem

dsm: don't store credentials in sub items options

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=68f4193ca3d18251f774a281c9f0f6d917941f6e
---

 modules/access/dsm/access.c |   32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)

diff --git a/modules/access/dsm/access.c b/modules/access/dsm/access.c
index 340d2fa..83b1b1e 100644
--- a/modules/access/dsm/access.c
+++ b/modules/access/dsm/access.c
@@ -106,9 +106,6 @@ struct access_sys_t
     vlc_url_t           url;
     char               *psz_share;
     char               *psz_path;
-    char               *psz_user_opt;
-    char               *psz_pwd_opt;
-    char               *psz_domain_opt;
 
     char                netbios_name[16];
     struct in_addr      addr;
@@ -218,9 +215,6 @@ static void Close( vlc_object_t *p_this )
         smb_share_list_destroy( p_sys->shares );
     if( p_sys->files )
         smb_stat_list_destroy( p_sys->files );
-    free( p_sys->psz_user_opt );
-    free( p_sys->psz_pwd_opt );
-    free( p_sys->psz_domain_opt );
     free( p_sys->psz_share );
     free( p_sys->psz_path );
     free( p_sys );
@@ -376,18 +370,7 @@ success:
     msg_Warn( p_access, "Creds: username = '%s', domain = '%s'",
              psz_login, psz_domain );
     if( !b_guest )
-    {
-        if( asprintf( &p_sys->psz_user_opt, "smb-user=%s", psz_login ) == -1 )
-            p_sys->psz_user_opt = NULL;
-        if( credential.psz_realm != NULL
-         && asprintf( &p_sys->psz_domain_opt, "smb-domain=%s",
-                      credential.psz_realm ) == -1 )
-            p_sys->psz_domain_opt = NULL;
-
-        if( !vlc_credential_store( &credential, p_access  )
-         && asprintf( &p_sys->psz_pwd_opt, "smb-pwd=%s", psz_password ) == -1 )
-            p_sys->psz_pwd_opt = NULL;
-    }
+        vlc_credential_store( &credential, p_access );
 
     i_ret = VLC_SUCCESS;
 error:
@@ -542,7 +525,6 @@ static int Control( access_t *p_access, int i_query, va_list args )
 static input_item_t *new_item( access_t *p_access, const char *psz_name,
                                int i_type )
 {
-    access_sys_t *p_sys = p_access->p_sys;
     input_item_t *p_item;
     char         *psz_uri;
     int           i_ret;
@@ -565,18 +547,6 @@ static input_item_t *new_item( access_t *p_access, const char *psz_name,
     if( p_item == NULL )
         return NULL;
 
-    /* Here we save on the node the credentials that allowed us to login.
-     * That way the user isn't prompted more than once for credentials */
-    if( p_sys->psz_user_opt != NULL )
-        input_item_AddOption( p_item, p_sys->psz_user_opt,
-                              VLC_INPUT_OPTION_TRUSTED );
-    if( p_sys->psz_pwd_opt != NULL )
-        input_item_AddOption( p_item, p_sys->psz_pwd_opt,
-                              VLC_INPUT_OPTION_TRUSTED );
-    if( p_sys->psz_domain_opt != NULL )
-        input_item_AddOption( p_item, p_sys->psz_domain_opt,
-                              VLC_INPUT_OPTION_TRUSTED );
-
     return p_item;
 }
 



More information about the vlc-commits mailing list