From 8352c6273452bda5bd36bcec6f53ee05c886f8b3 Mon Sep 17 00:00:00 2001 From: Thomas Guillem Date: Fri, 9 Jun 2023 13:40:37 +0200 Subject: [PATCH] samba: fix anonymous login with last Windows update Refs #28187 --- modules/access/samba.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/access/samba.c b/modules/access/samba.c index b3f10de592..9fe7376e55 100644 --- a/modules/access/samba.c +++ b/modules/access/samba.c @@ -263,6 +263,14 @@ static void smb_auth(SMBCCTX *ctx, const char *srv, const char *shr, strlcpy(un, sys->credential.psz_username, unlen); if (sys->credential.psz_password != NULL) strlcpy(pw, sys->credential.psz_password, pwlen); + else + { + /* Since last Windows 11 update (KB5026436), Windows SMB servers need a + * valid Auth (user + password) even for a guest/anonymous login. + * Therefore, store the user in the password to fake a valid password. + * */ + strlcpy(pw, un, pwlen); + } } static int Open(vlc_object_t *obj)