[vlc-commits] vlc_credential: fix domain/username switch for smb
Thomas Guillem
git at videolan.org
Mon Jan 9 18:00:23 CET 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jan 9 17:59:15 2017 +0100| [e6903a193d6ec3db83091e46ad6e24019dab6e9a] | committer: Thomas Guillem
vlc_credential: fix domain/username switch for smb
Fixes #17858
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e6903a193d6ec3db83091e46ad6e24019dab6e9a
---
include/vlc_keystore.h | 2 +-
src/misc/keystore.c | 9 +++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/vlc_keystore.h b/include/vlc_keystore.h
index 67765a4..5d143df 100644
--- a/include/vlc_keystore.h
+++ b/include/vlc_keystore.h
@@ -185,7 +185,7 @@ struct vlc_credential
vlc_keystore_entry *p_entries;
unsigned int i_entries_count;
- char *psz_split_username;
+ char *psz_split_domain;
char *psz_var_username;
char *psz_var_password;
diff --git a/src/misc/keystore.c b/src/misc/keystore.c
index 3f9077c..79c9b57 100644
--- a/src/misc/keystore.c
+++ b/src/misc/keystore.c
@@ -277,11 +277,12 @@ smb_split_domain(vlc_credential *p_credential)
size_t i_len = psz_delim - p_credential->psz_username;
if (i_len > 0)
{
- p_credential->psz_split_username =
+ free(p_credential->psz_split_domain);
+ p_credential->psz_split_domain =
strndup(p_credential->psz_username, i_len);
- p_credential->psz_username = p_credential->psz_split_username;
+ p_credential->psz_realm = p_credential->psz_split_domain;
}
- p_credential->psz_realm = psz_delim + 1;
+ p_credential->psz_username = psz_delim + 1;
}
}
@@ -362,7 +363,7 @@ vlc_credential_clean(vlc_credential *p_credential)
if (p_credential->p_keystore)
vlc_keystore_release(p_credential->p_keystore);
- free(p_credential->psz_split_username);
+ free(p_credential->psz_split_domain);
free(p_credential->psz_var_username);
free(p_credential->psz_var_password);
free(p_credential->psz_dialog_username);
More information about the vlc-commits
mailing list