Commit c988de29 authored by Paulo Alcantara's avatar Paulo Alcantara Committed by Steve French

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: a6b5058f ("fs/cifs: make share unaccessible at root level mountable")
Signed-off-by: default avatarPaulo Alcantara <palcantara@suse.com>
Reviewed-by: default avatarAurelien Aptel <aaptel@suse.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
parent 6e785302
...@@ -174,7 +174,7 @@ build_path_from_dentry_optional_prefix(struct dentry *direntry, bool prefix) ...@@ -174,7 +174,7 @@ build_path_from_dentry_optional_prefix(struct dentry *direntry, bool prefix)
cifs_dbg(FYI, "using cifs_sb prepath <%s>\n", cifs_sb->prepath); cifs_dbg(FYI, "using cifs_sb prepath <%s>\n", cifs_sb->prepath);
memcpy(full_path+dfsplen+1, cifs_sb->prepath, pplen-1); memcpy(full_path+dfsplen+1, cifs_sb->prepath, pplen-1);
full_path[dfsplen] = '\\'; full_path[dfsplen] = dirsep;
for (i = 0; i < pplen-1; i++) for (i = 0; i < pplen-1; i++)
if (full_path[dfsplen+1+i] == '/') if (full_path[dfsplen+1+i] == '/')
full_path[dfsplen+1+i] = CIFS_DIR_SEP(cifs_sb); full_path[dfsplen+1+i] = CIFS_DIR_SEP(cifs_sb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment