From patchwork Thu Apr 29 15:05:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 51298 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 86EECB7D11 for ; Fri, 30 Apr 2010 01:05:29 +1000 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 0C3C3AD21C; Thu, 29 Apr 2010 09:05:29 -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=-1.7 required=3.8 tests=AWL,BAYES_00,NO_MORE_FUNN 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.122]) by lists.samba.org (Postfix) with ESMTP id DB92CAD126 for ; Thu, 29 Apr 2010 09:05:21 -0600 (MDT) X-Authority-Analysis: v=1.1 cv=5yfpY6a+vWfUYjBKf4bPJkZKLz0VBYFTnnPBrA4h/TU= c=1 sm=0 a=EE_w91XupsoA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=hGzw-44bAAAA:8 a=zio6NBrinkKepI5IV44A:9 a=bR0Am3s-kQw2hFVHRNmR7a9f9moA: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:39158] helo=mail.poochiereds.net) by cdptpa-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id F6/73-20383-030A9DB4; Thu, 29 Apr 2010 15:05:21 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id A0E825809D; Thu, 29 Apr 2010 11:05:20 -0400 (EDT) From: Jeff Layton To: linux-cifs-client@lists.samba.org Date: Thu, 29 Apr 2010 11:05:20 -0400 Message-Id: <1272553520-22066-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 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 | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/mount.cifs.c b/mount.cifs.c index 1040e8b..6e5afe3 100644 --- a/mount.cifs.c +++ b/mount.cifs.c @@ -1168,7 +1168,7 @@ static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info return EX_USAGE; } - prepath = share + sharelen; + prepath = share + sharelen + 1; prepathlen = strlen(prepath); if (prepathlen + 1 > sizeof(parsed_info->prefix)) { @@ -1669,6 +1669,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 +1685,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;