diff options
author | Paulo Alcantara <palcantara@suse.com> | 2018-11-15 09:20:52 -0500 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2018-12-06 03:20:17 -0500 |
commit | c988de29ca161823db6a7125e803d597ef75b49c (patch) | |
tree | 2b3c4c3f812b3b9adb39c59e06b9f022d4891c53 | |
parent | 6e785302dad32228819d8066e5376acd15d0e6ba (diff) |
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 <palcantara@suse.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
-rw-r--r-- | fs/cifs/dir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 3713d22b95a7..907e85d65bb4 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -174,7 +174,7 @@ cifs_bp_rename_retry: | |||
174 | 174 | ||
175 | cifs_dbg(FYI, "using cifs_sb prepath <%s>\n", cifs_sb->prepath); | 175 | cifs_dbg(FYI, "using cifs_sb prepath <%s>\n", cifs_sb->prepath); |
176 | memcpy(full_path+dfsplen+1, cifs_sb->prepath, pplen-1); | 176 | memcpy(full_path+dfsplen+1, cifs_sb->prepath, pplen-1); |
177 | full_path[dfsplen] = '\\'; | 177 | full_path[dfsplen] = dirsep; |
178 | for (i = 0; i < pplen-1; i++) | 178 | for (i = 0; i < pplen-1; i++) |
179 | if (full_path[dfsplen+1+i] == '/') | 179 | if (full_path[dfsplen+1+i] == '/') |
180 | full_path[dfsplen+1+i] = CIFS_DIR_SEP(cifs_sb); | 180 | full_path[dfsplen+1+i] = CIFS_DIR_SEP(cifs_sb); |