diff mbox

cifs/dir.c: use correct path separator

Message ID mps60q8sy4z.fsf@suse.com (mailing list archive)
State New, archived
Headers show

Commit Message

Aurélien Aptel Sept. 6, 2016, 6:04 p.m. UTC
Current code hardcodes the path separator to backslash. The loop after
it that switches the slashes direction only operates on the dfs prefix,
not the whole path. Use CIFS_DIR_SEP instead.

Comments

Sachin Prabhu Sept. 7, 2016, 9:27 a.m. UTC | #1
On Tue, 2016-09-06 at 20:04 +0200, Aurélien Aptel wrote:
> Current code hardcodes the path separator to backslash. The loop
> after
> it that switches the slashes direction only operates on the dfs
> prefix,
> not the whole path. Use CIFS_DIR_SEP instead.
> 
Hello Aurélien,

Can you please add this summary to the patch summary and repost the
patch using git send-email instead. Having the patch inline makes it a
bit easier to review the patch.

Sachin Prabhu
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Aurélien Aptel Sept. 8, 2016, 10:53 a.m. UTC | #2
Sachin Prabhu <sprabhu@redhat.com> writes:
> Can you please add this summary to the patch summary and repost the
> patch using git send-email instead. Having the patch inline makes it a
> bit easier to review the patch.

No problem. I've took time to work on it a bit before re-sending too
(new thread).
diff mbox

Patch

From cf6070073e817e48efc5ec72639eaeb848d6c002 Mon Sep 17 00:00:00 2001
From: Aurelien Aptel <aaptel@suse.com>
Date: Tue, 6 Sep 2016 19:58:28 +0200
Subject: [PATCH] fs/cifs/dir.c: use correct path separator

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 4716c54..c753748 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] = CIFS_DIR_SEP(cifs_sb);
 		for (i = 0; i < pplen-1; i++)
 			if (full_path[dfsplen+1+i] == '/')
 				full_path[dfsplen+1+i] = CIFS_DIR_SEP(cifs_sb);
-- 
2.1.4