diff mbox series

[v1,03/14] cifs: Fix separator when building path from dentry

Message ID 20181115142103.24617-4-aaptel@suse.com (mailing list archive)
State New, archived
Headers show
Series DFS failover | expand

Commit Message

Aurélien Aptel Nov. 15, 2018, 2:20 p.m. UTC
From: Paulo Alcantara <paulo@paulo.ac>

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: Aurelien Aptel <aaptel@suse.com>
---
 fs/cifs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steve French Nov. 23, 2018, 6:14 p.m. UTC | #1
merged into cifs-2.6.git for-next and added cc:stable
On Thu, Nov 15, 2018 at 8:21 AM Aurelien Aptel <aaptel@suse.com> wrote:
>
> From: Paulo Alcantara <paulo@paulo.ac>
>
> 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: Aurelien Aptel <aaptel@suse.com>
> ---
>  fs/cifs/dir.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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 @@ build_path_from_dentry_optional_prefix(struct dentry *direntry, bool prefix)
>
>                 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);
> --
> 2.13.7
>
diff mbox series

Patch

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 @@  build_path_from_dentry_optional_prefix(struct dentry *direntry, bool prefix)
 
 		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);