From patchwork Fri Apr 30 11:21:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 51326 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by ozlabs.org (Postfix) with ESMTP id A71D0B7D1D for ; Fri, 30 Apr 2010 21:21:38 +1000 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id A796CAD296; Fri, 30 Apr 2010 05:21:40 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.8 tests=AWL, BAYES_00, NO_MORE_FUNN, SPF_PASS autolearn=no version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from cdptpa-omtalb.mail.rr.com (cdptpa-omtalb.mail.rr.com [75.180.132.120]) by lists.samba.org (Postfix) with ESMTP id 6BB0BAD290 for ; Fri, 30 Apr 2010 05:21:33 -0600 (MDT) X-Authority-Analysis: v=1.1 cv=5yfpY6a+vWfUYjBKf4bPJkZKLz0VBYFTnnPBrA4h/TU= c=1 sm=0 a=a6srnI1uWhYA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=hGzw-44bAAAA:8 a=OS60bVbMsyvbAQFLcCIA:9 a=1Tw4h2zevXBe6FXve1IWg5c-fYgA:4 a=jEp0ucaQiEUA:10 a=dowx1zmaLagA:10 a=ld/erqUjW76FpBUqCqkKeA==:117 X-Cloudmark-Score: 0 X-Originating-IP: 71.70.153.3 Received: from [71.70.153.3] ([71.70.153.3:53928] helo=mail.poochiereds.net) by cdptpa-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id 4C/4E-20383-93DBADB4; Fri, 30 Apr 2010 11:21:29 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id 5FEAB5809B; Fri, 30 Apr 2010 07:21:29 -0400 (EDT) From: Jeff Layton To: linux-cifs-client@lists.samba.org Date: Fri, 30 Apr 2010 07:21:29 -0400 Message-Id: <1272626489-21264-1-git-send-email-jlayton@samba.org> X-Mailer: git-send-email 1.6.6.1 Subject: [linux-cifs-client] [PATCH] mount.cifs: strip leading delimiter off of prefixpath option (try #2) X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org ...the kernel doesn't expect to see it and it causes a regression when mounting some UNCs. Reported-by: Ales Zelinka Signed-off-by: Jeff Layton --- mount.cifs.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/mount.cifs.c b/mount.cifs.c index 1040e8b..c4eb59a 100644 --- a/mount.cifs.c +++ b/mount.cifs.c @@ -1169,6 +1169,9 @@ static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info } prepath = share + sharelen; + if (*prepath != '\0') + prepath++; + prepathlen = strlen(prepath); if (prepathlen + 1 > sizeof(parsed_info->prefix)) { @@ -1669,6 +1672,7 @@ int main(int argc, char **argv) goto mount_exit; } + /* lengths of different strings + slashes + trailing \0 */ dev_len = strnlen(parsed_info->host, sizeof(parsed_info->host)) + strnlen(parsed_info->share, sizeof(parsed_info->share)) + strnlen(parsed_info->prefix, sizeof(parsed_info->prefix)) + @@ -1684,6 +1688,7 @@ int main(int argc, char **argv) strlcat(dev_name, parsed_info->host, dev_len); strlcat(dev_name, "/", dev_len); strlcat(dev_name, parsed_info->share, dev_len); + strlcat(dev_name, "/", dev_len); strlcat(dev_name, parsed_info->prefix, dev_len); currentaddress = parsed_info->addrlist;