From patchwork Tue Sep 6 18:04:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Aur=C3=A9lien_Aptel?= X-Patchwork-Id: 9317763 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7E077607D3 for ; Tue, 6 Sep 2016 18:05:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 791EF281AA for ; Tue, 6 Sep 2016 18:05:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 694E928E30; Tue, 6 Sep 2016 18:05:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AB73281AA for ; Tue, 6 Sep 2016 18:05:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938882AbcIFSFC (ORCPT ); Tue, 6 Sep 2016 14:05:02 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:51929 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938677AbcIFSFC (ORCPT ); Tue, 6 Sep 2016 14:05:02 -0400 Received: from nwb-ext-pat.microfocus.com ([10.120.13.103]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Tue, 06 Sep 2016 20:04:59 +0200 Received: from localhost (nwb-a10-snat.microfocus.com [10.120.13.202]) by nwb-ext-pat.microfocus.com with ESMTP (TLS encrypted); Tue, 06 Sep 2016 19:04:31 +0100 From: =?utf-8?Q?Aur=C3=A9lien?= Aptel To: linux-cifs Subject: [PATCH] cifs/dir.c: use correct path separator User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) Date: Tue, 06 Sep 2016 20:04:28 +0200 Message-ID: MIME-Version: 1.0 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. From cf6070073e817e48efc5ec72639eaeb848d6c002 Mon Sep 17 00:00:00 2001 From: Aurelien Aptel Date: Tue, 6 Sep 2016 19:58:28 +0200 Subject: [PATCH] fs/cifs/dir.c: use correct path separator Signed-off-by: Aurelien Aptel --- 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