• Paulo Alcantara's avatar
    smb: client: fix parsing of source mount option · 49024ec8
    Paulo Alcantara authored
    Handle trailing and leading separators when parsing UNC and prefix
    paths in smb3_parse_devname().  Then, store the sanitised paths in
    smb3_fs_context::source.
    
    This fixes the following cases
    
    $ mount //srv/share// /mnt/1 -o ...
    $ cat /mnt/1/d0/f0
    cat: /mnt/1/d0/f0: Invalid argument
    
    The -EINVAL was returned because the client sent SMB2_CREATE "\\d0\f0"
    rather than SMB2_CREATE "\d0\f0".
    
    $ mount //srv//share /mnt/1 -o ...
    mount: Invalid argument
    
    The -EINVAL was returned correctly although the client only realised
    it after sending a couple of bad requests rather than bailing out
    earlier when parsing mount options.
    Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@manguebit.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    49024ec8
dfs.c 15.2 KB