]> www.infradead.org Git - users/jedix/linux-maple.git/commit
smb: client: fix DFS mount against old servers with NTLMSSP
authorPaulo Alcantara <pc@manguebit.com>
Fri, 3 Jan 2025 19:58:12 +0000 (16:58 -0300)
committerSteve French <stfrench@microsoft.com>
Mon, 20 Jan 2025 01:34:00 +0000 (19:34 -0600)
commitad46faff1afcc8db72f9954a6ea2296d31259217
tree7938327a62e8c35757874d52a965e84029f71c26
parent0e8ae9b953bc2c12aebd21e1e552e5deb1a0ff1e
smb: client: fix DFS mount against old servers with NTLMSSP

Old Windows servers will return not fully qualified DFS targets by
default as specified in

  MS-DFSC 3.2.5.5 Receiving a Root Referral Request or Link Referral
  Request

    | Servers SHOULD<30> return fully qualified DNS host names of
    | targets in responses to root referral requests and link referral
    | requests.
    | ...
    | <30> Section 3.2.5.5: By default, Windows Server 2003, Windows
    | Server 2008, Windows Server 2008 R2, Windows Server 2012, and
    | Windows Server 2012 R2 return DNS host names that are not fully
    | qualified for targets.

Fix this by converting all NetBIOS host names from DFS targets to
FQDNs and try resolving them first if DNS domain name was provided in
NTLMSSP CHALLENGE_MESSAGE message from previous SMB2_SESSION_SETUP.
This also prevents the client from translating the DFS target
hostnames to another domain depending on the network domain search
order.

Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsglob.h
fs/smb/client/connect.c
fs/smb/client/dfs.c
fs/smb/client/dfs_cache.c
fs/smb/client/dns_resolve.c
fs/smb/client/dns_resolve.h
fs/smb/client/fs_context.c
fs/smb/client/fs_context.h
fs/smb/client/misc.c