From patchwork Fri Aug 5 14:28:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1038782 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p75ES8Gv007282 for ; Fri, 5 Aug 2011 14:28:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754258Ab1HEO2H (ORCPT ); Fri, 5 Aug 2011 10:28:07 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:64515 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753216Ab1HEO2G (ORCPT ); Fri, 5 Aug 2011 10:28:06 -0400 Received: by ywn13 with SMTP id 13so1697084ywn.19 for ; Fri, 05 Aug 2011 07:28:06 -0700 (PDT) Received: by 10.100.254.3 with SMTP id b3mr1987746ani.116.1312554485966; Fri, 05 Aug 2011 07:28:05 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-076-182-054-018.nc.res.rr.com [76.182.54.18]) by mx.google.com with ESMTPS id l38sm2363788ani.18.2011.08.05.07.28.04 (version=SSLv3 cipher=OTHER); Fri, 05 Aug 2011 07:28:05 -0700 (PDT) From: Jeff Layton To: smfrench@gmail.com Cc: piastryyy@gmail.com, linux-cifs@vger.kernel.org Subject: [PATCH] cifs: convert prefixpath delimiters in cifs_build_path_to_root Date: Fri, 5 Aug 2011 10:28:01 -0400 Message-Id: <1312554481-1886-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.6 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 05 Aug 2011 14:28:08 +0000 (UTC) Regression from 2.6.39... The delimiters in the prefixpath are not being converted based on whether posix paths are in effect. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=727834 Reported-and-Tested-by: Iain Arnell Reported-by: Patrick Oltmann Cc: Pavel Shilovsky Cc: stable@kernel.org Signed-off-by: Jeff Layton --- fs/cifs/inode.c | 14 ++------------ 1 files changed, 2 insertions(+), 12 deletions(-) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 9b018c8..a7b2dcd 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -764,20 +764,10 @@ char *cifs_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, if (full_path == NULL) return full_path; - if (dfsplen) { + if (dfsplen) strncpy(full_path, tcon->treeName, dfsplen); - /* switch slash direction in prepath depending on whether - * windows or posix style path names - */ - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) { - int i; - for (i = 0; i < dfsplen; i++) { - if (full_path[i] == '\\') - full_path[i] = '/'; - } - } - } strncpy(full_path + dfsplen, vol->prepath, pplen); + convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb)); full_path[dfsplen + pplen] = 0; /* add trailing null */ return full_path; }