From: Paulo Alcantara Date: Thu, 15 Nov 2018 14:20:52 +0000 (+0100) Subject: cifs: Fix separator when building path from dentry X-Git-Tag: v5.15~7459^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c988de29ca161823db6a7125e803d597ef75b49c;p=platform%2Fkernel%2Flinux-starfive.git cifs: Fix separator when building path from dentry Make sure to use the CIFS_DIR_SEP(cifs_sb) as path separator for prefixpath too. Fixes a bug with smb1 UNIX extensions. Fixes: a6b5058fafdf ("fs/cifs: make share unaccessible at root level mountable") Signed-off-by: Paulo Alcantara Reviewed-by: Aurelien Aptel Signed-off-by: Steve French CC: Stable --- diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 3713d22..907e85d 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -174,7 +174,7 @@ cifs_bp_rename_retry: cifs_dbg(FYI, "using cifs_sb prepath <%s>\n", cifs_sb->prepath); memcpy(full_path+dfsplen+1, cifs_sb->prepath, pplen-1); - full_path[dfsplen] = '\\'; + full_path[dfsplen] = dirsep; for (i = 0; i < pplen-1; i++) if (full_path[dfsplen+1+i] == '/') full_path[dfsplen+1+i] = CIFS_DIR_SEP(cifs_sb);