Commit 40035be6 authored by Thomas Guillem's avatar Thomas Guillem

smb2/dsm: avoid to request the dialog two times

parent 3924c4e7
......@@ -334,6 +334,12 @@ static int login( stream_t *p_access )
if( smb_connect( p_access, psz_login, psz_password, psz_domain )
!= VLC_SUCCESS )
{
if (var_Type(p_access, "smb-dialog-failed") != 0)
{
/* A higher priority smb module (likely smb2) already requested
* credentials to the users. It is useless to request it again. */
goto error;
}
while( vlc_credential_get( &credential, p_access, "smb-user", "smb-pwd",
SMB_LOGIN_DIALOG_TITLE,
SMB_LOGIN_DIALOG_TEXT, p_sys->netbios_name ) )
......
......@@ -673,6 +673,13 @@ Open(vlc_object_t *p_obj)
if (error && *error)
vlc_dialog_display_error(access,
_("SMB2 operation failed"), "%s", error);
if (credential.i_get_order == GET_FROM_DIALOG)
{
/* Tell other smb modules (likely dsm) that we already requested
* credential to the users and that it it useless to try again.
* This avoid to show 2 login dialogs for the same access. */
var_Create(access, "smb-dialog-failed", VLC_VAR_VOID);
}
goto error;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment