Skip to content

Commit

Permalink
cifs: fix potential mismatch of UNC paths
Browse files Browse the repository at this point in the history
Ensure that full_path is an UNC path that contains '\\' as delimiter,
which is required by cifs_build_devname().

The build_path_from_dentry_optional_prefix() function may return a
path with '/' as delimiter when using SMB1 UNIX extensions, for
example.

Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Acked-by: Ronnie Sahlberg <lsahlber@redhat.com>
  • Loading branch information
Paulo Alcantara (SUSE) authored and Steve French committed Feb 24, 2020
1 parent fc513fa commit 1542552
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/cifs/cifs_dfs_ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
if (full_path == NULL)
goto cdda_exit;

convert_delimiter(full_path, '\\');

cifs_dbg(FYI, "%s: full_path: %s\n", __func__, full_path);

if (!cifs_sb_master_tlink(cifs_sb)) {
Expand Down

0 comments on commit 1542552

Please sign in to comment.