[vlc-commits] smb2: always store credentials in case of success

Thomas Guillem git at videolan.org
Fri Sep 20 12:51:51 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Sep 20 12:49:30 2019 +0200| [53673b7ef285f46b345ba01647df39afb65f25d6] | committer: Thomas Guillem

smb2: always store credentials in case of success

Like other access modules. The credential was stored (in memory) only when
there was an interaction with the user. It should also be saved when the
credential comes from vlc options like "smb-user", "smb-pwd".

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

 modules/access/smb2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/access/smb2.c b/modules/access/smb2.c
index d6d55c5ffc..5c97497ef0 100644
--- a/modules/access/smb2.c
+++ b/modules/access/smb2.c
@@ -662,9 +662,9 @@ Open(vlc_object_t *p_obj)
     {
         sys->error_status = 0;
         ret = vlc_smb2_open_share(access, smb2_url, &credential);
-        if (ret == 0)
-            vlc_credential_store(&credential, access);
     }
+    if (ret == 0)
+        vlc_credential_store(&credential, access);
     vlc_credential_clean(&credential);
 
     if (ret != 0)



More information about the vlc-commits mailing list