VLC tries to connect with Guest account

VLC for Android and Chrome OS specific usage questions
NasGuest
New Cone
New Cone
Posts: 5
Joined: 11 Dec 2020 21:22

VLC tries to connect with Guest account

Postby NasGuest » 12 Dec 2020 07:07

Hi there,

i'm using VLC version 3.3.2 on 3 devices (Phone, Tablet, Fire-TV stick) with a FritzBox 7490 (OS version 07.21) and a WD elements as NAS storage. I'm not using the built in media server of the FritzBox, because it's terribly slow. Access via SMB/NAS is faster by far.

But currently there are 2 things that are confusing me:

1) Every access to the NAS (every folder change that is) seems to need a new login procedure on the NAS.
2) Every access tries to connect me with my NAS account user (nasuser) following by an failed attempt to connect me with "Guest" with a message "login user Guest at FRITZ!Box-SMB-service from IP-Adress X.X.X.X failed (User doesn't exist)" (See attached screenshot).

This happens on all 3 devices and it doesn't matter if i'm enabling SMB1 access or not. I've tried it with another software (Samba Network Music Player) and though it requires SMB1, there is no second login try. Also with my desktop PC and Windows 10 (SMB1 disabled!) there is only 1 connection attempt with the correct user to the NAS no matter how many folders or actions i trigger.

I've found the exact same topic over here: https://trac.videolan.org/vlc/ticket/22032 but thats a nearly 2 year old topic.

So for me it seems that this is a flaw in the android version of the vlc player.

Does anybody here have the same behaviour or knows the cause and how to fix it?

Here are the screenshots: https://imgur.com/a/gTqfAiY

Here are the messages as plain text

Fritzbox log Android 3.3.2
11.12.20 10:53:29 Anmeldung des Benutzers nasuser am FRITZ!Box SMB-Dienst von IP-Adresse 192.168.0.32.
11.12.20 10:53:29 Anmeldung des Benutzers Guest am FRITZ!Box SMB-Dienst von IP-Adresse 192.168.0.32 gescheitert (Benutzer existiert nicht).
11.12.20 10:53:29 Anmeldung des Benutzers nasuser am FRITZ!Box SMB-Dienst von IP-Adresse 192.168.0.32.
11.12.20 10:53:29 Anmeldung des Benutzers Guest am FRITZ!Box SMB-Dienst von IP-Adresse 192.168.0.32 gescheitert (Benutzer existiert nicht).
Fritzbox log Windows 10
12.12.20 06:56:02 Anmeldung des Benutzers nasuser am FRITZ!Box SMB-Dienst von IP-Adresse 192.168.0.2.
Thanks in advance

NasGuest

NasGuest
New Cone
New Cone
Posts: 5
Joined: 11 Dec 2020 21:22

Re: VLC tries to connect with Guest account

Postby NasGuest » 12 Dec 2020 08:02

Found something in the master branch of smb2.c maybe it has something to do with it? Would explain that they implemented something as test/fallback for the smb2 protocol. Doesn't explain why it tries to connect with the correct user first and with the "Guest" account afterwards. Does also nit explain why this code would be in use if SMB1 access is enabled.

Code: Select all

static int Open(vlc_object_t *p_obj) { stream_t *access = (stream_t *)p_obj; struct access_sys *sys = vlc_obj_calloc(p_obj, 1, sizeof (*sys)); char *var_domain = NULL; if (unlikely(sys == NULL)) return VLC_ENOMEM; access->p_sys = sys; /* Parse the encoded URL */ if (vlc_UrlParseFixup(&sys->encoded_url, access->psz_url) != 0) return VLC_ENOMEM; if (sys->encoded_url.psz_path == NULL) sys->encoded_url.psz_path = (char *) "/"; char *resolved_host = vlc_smb2_resolve(access, sys->encoded_url.psz_host, sys->encoded_url.i_port); const char *host; /* smb2_* functions need a decoded url. Re compose the url from the * modified sys->encoded_url (with the resolved host). */ char *url; if (resolved_host != NULL) { vlc_url_t resolved_url = sys->encoded_url; resolved_url.psz_host = resolved_host; url = vlc_uri_compose(&resolved_url); host = resolved_host; } else { url = vlc_uri_compose(&sys->encoded_url); host = sys->encoded_url.psz_host; } if (!vlc_uri_decode(url)) { free(url); free(resolved_host); goto error; } int ret = -1; vlc_credential credential; vlc_credential_init(&credential, &sys->encoded_url); var_domain = var_InheritString(access, "smb-domain"); credential.psz_realm = var_domain; /* First, try Guest login or using "smb-" options (without * keystore/user interaction) */ vlc_credential_get(&credential, access, "smb-user", "smb-pwd", NULL, NULL); ret = vlc_smb2_open_share(access, url, &credential); while (ret == -1 && (!sys->error_status || VLC_SMB2_STATUS_DENIED(sys->error_status)) && vlc_credential_get(&credential, access, "smb-user", "smb-pwd", SMB_LOGIN_DIALOG_TITLE, SMB_LOGIN_DIALOG_TEXT, host)) { sys->error_status = 0; ret = vlc_smb2_open_share(access, url, &credential); } free(resolved_host); free(url); if (ret == 0) vlc_credential_store(&credential, access); vlc_credential_clean(&credential); if (ret != 0) { const char *error = smb2_get_error(sys->smb2); 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; } if (sys->smb2fh != NULL) { access->pf_read = FileRead; access->pf_seek = FileSeek; access->pf_control = FileControl; } else if (sys->smb2dir != NULL) { access->pf_readdir = DirRead; access->pf_seek = NULL; access->pf_control = access_vaDirectoryControlHelper; } else if (sys->share_enum != NULL) { access->pf_readdir = ShareEnum; access->pf_seek = NULL; access->pf_control = access_vaDirectoryControlHelper; } else vlc_assert_unreachable(); free(var_domain); return VLC_SUCCESS; error: vlc_UrlClean(&sys->encoded_url); free(var_domain); /* Returning VLC_ETIMEOUT will stop the module probe and prevent to load * the next smb module. The smb2 module can return this specific error in * case of network error (EIO) or when the user asked to cancel it * (vlc_killed()). Indeed, in these cases, it is useless to try next smb * modules. */ return vlc_killed() || sys->error_status == -EIO ? VLC_ETIMEOUT : VLC_EGENERIC; }

NasGuest
New Cone
New Cone
Posts: 5
Joined: 11 Dec 2020 21:22

Re: VLC tries to connect with Guest account

Postby NasGuest » 12 Dec 2020 08:02

Also there was some patch in the android version in the file 0009-smb2-use-new-happy-eyeballs-API.patch

Code: Select all

+diff --git a/lib/init.c b/lib/init.c +index 8b4ff01..493dcd8 100644 +--- a/lib/init.c ++++ b/lib/init.c +@@ -44,6 +44,7 @@ + #include <stdarg.h> + #include <stdio.h> + #include <time.h> ++#include <assert.h> + + #ifndef PS2_EE_PLATFORM + #include <sys/socket.h> +@@ -274,6 +275,10 @@ struct smb2_context *smb2_init_context(void) + ret = getlogin_r(buf, sizeof(buf)); + smb2_set_user(smb2, ret == 0 ? buf : "Guest"); + smb2->fd = -1; ++ smb2->connecting_fds = NULL; ++ smb2->connecting_fds_count = 0; ++ smb2->addrinfos = NULL; ++ smb2->next_addrinfo = NULL; + smb2->sec = SMB2_SEC_UNDEFINED; + smb2->version = SMB2_VERSION_ANY; + smb2->ndr = 1; +@@ -299,12 +304,17 @@ void smb2_destroy_context(struct smb2_context *smb2) + } + + if (smb2->fd != -1) { ++ assert(smb2->connecting_fds == NULL); ++ assert(smb2->addrinfos == NULL); + if (smb2->change_fd) { + smb2->change_fd(smb2, smb2->fd, SMB2_DEL_FD); + } + close(smb2->fd); + smb2->fd = -1; + } ++ else { ++ smb2_close_connecting_fds(smb2); ++ } + + while (smb2->outqueue) { + struct smb2_pdu *pdu = smb2->outqueue;
Maybe something a developer wants to take a closer look...

Aza
Developer
Developer
Posts: 2010
Joined: 14 Mar 2019 10:04

Re: VLC tries to connect with Guest account

Postby Aza » 14 Dec 2020 07:14

Could you please try to install the beta version of VLC (3.3.3 beta 4) and send some logs?
To do so, reproduce the issue and then go to: Settings > Advanced > Debug logs. Then share the logs with the sharing service you prefer (Google Drive, Dropbox, pastebin...).
To install the beta, you can enter the beta channel or download it here: http://get.videolan.org/testing/android/3.3.3-Beta-4/

NasGuest
New Cone
New Cone
Posts: 5
Joined: 11 Dec 2020 21:22

Re: VLC tries to connect with Guest account

Postby NasGuest » 14 Dec 2020 14:48

I've installed the beta on my phone and created some logs...

So here they are... One with SMB1 enabled and one with SMB1 disabled on FritzBox NAS
https://drive.google.com/file/d/1DTCaod ... sp=sharing

tguillem
Developer
Developer
Posts: 87
Joined: 04 May 2015 16:38
VLC version: ALL
Operating System: Linux/WIndows/Mac OS

Re: VLC tries to connect with Guest account

Postby tguillem » 15 Dec 2020 09:46

Hello NasGuest.

Currently, VLC try first to connect to the guest account, then ask for the user or fetch the user that was previously used.

I could do the following change that is more logical:
- The first time ever, VLC try to connect to guest than ask for user/password.
- Next times, VLC connect directly for the user/password previously saved
- I could also save the ip address that connected successfully to avoid trying ipv6 and ipv4 each time.

This won't change the fact that a new connection is required each time you browse or open a file. This will be harder to fix.

NasGuest
New Cone
New Cone
Posts: 5
Joined: 11 Dec 2020 21:22

Re: VLC tries to connect with Guest account

Postby NasGuest » 16 Dec 2020 06:04

I could do the following change that is more logical:
- The first time ever, VLC try to connect to guest than ask for user/password.
- Next times, VLC connect directly for the user/password previously saved
- I could also save the ip address that connected successfully to avoid trying ipv6 and ipv4 each time.
That would be great if it would work that way.
This won't change the fact that a new connection is required each time you browse or open a file. This will be harder to fix.
I understand that this would be a huge rewrite in the vlc code maybe you could put this on the todo list for a future release candidate. It's not necessary, but please think about it.

Many thanks and best regards

NasGuest

Age83
New Cone
New Cone
Posts: 1
Joined: 01 Jan 2021 22:12

Re: VLC tries to connect with Guest account

Postby Age83 » 01 Jan 2021 22:17

Hello NasGuest.

Currently, VLC try first to connect to the guest account, then ask for the user or fetch the user that was previously used.

I could do the following change that is more logical:
- The first time ever, VLC try to connect to guest than ask for user/password.
- Next times, VLC connect directly for the user/password previously saved
- I could also save the ip address that connected successfully to avoid trying ipv6 and ipv4 each time.

This won't change the fact that a new connection is required each time you browse or open a file. This will be harder to fix.
Hi tguillem,

I am having a very similar issue as NasGuest although in my case, once the first attempt with the Guest account fails, VLC does not ask for a new username and pw. It simply gets rejected and stops trying. I am using some older hardware as well, a D-Link DNS-325 as a smb connection for streaming music to my phone.

Is this something that will most likely be fixed?

Thanks,


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: XTRANGE and 13 guests