summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <palcantara@suse.com>2018-11-15 15:20:52 +0100
committerBen Hutchings <ben@decadent.org.uk>2019-02-11 17:54:21 +0000
commit9475b187931eea31993ae91446c9a4e76e8d0302 (patch)
tree191f75857ae61536ae744e8096852134cd99a567
parentf8860a91d7538022c1c3f0bdddeec9a9d83e0c09 (diff)
downloadlinux-stable-9475b187931eea31993ae91446c9a4e76e8d0302.tar.gz
linux-stable-9475b187931eea31993ae91446c9a4e76e8d0302.tar.bz2
linux-stable-9475b187931eea31993ae91446c9a4e76e8d0302.zip
cifs: Fix separator when building path from dentry
commit c988de29ca161823db6a7125e803d597ef75b49c upstream. 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 <palcantara@suse.com> Reviewed-by: Aurelien Aptel <aaptel@suse.com> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--fs/cifs/dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 75eac1424c5b..07e2465c0d50 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -163,7 +163,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);