2010-04-30 19:16:22 +00:00
|
|
|
From df6188fc6b3bcf4749cb76c755fe24241cf9455c Mon Sep 17 00:00:00 2001
|
2010-04-29 19:44:43 +00:00
|
|
|
From: Jeff Layton <jlayton@samba.org>
|
2010-04-30 19:16:22 +00:00
|
|
|
Date: Fri, 30 Apr 2010 07:19:53 -0400
|
|
|
|
Subject: [PATCH] mount.cifs: strip leading delimiter off of prefixpath option (try #2)
|
2010-04-29 19:44:43 +00:00
|
|
|
|
|
|
|
...the kernel doesn't expect to see it and it causes a regression
|
|
|
|
when mounting some UNCs.
|
|
|
|
|
|
|
|
Reported-by: Ales Zelinka <azelinka@redhat.com>
|
|
|
|
Signed-off-by: Jeff Layton <jlayton@samba.org>
|
|
|
|
---
|
2010-04-30 19:16:22 +00:00
|
|
|
mount.cifs.c | 5 +++++
|
|
|
|
1 files changed, 5 insertions(+), 0 deletions(-)
|
2010-04-29 19:44:43 +00:00
|
|
|
|
|
|
|
diff --git a/mount.cifs.c b/mount.cifs.c
|
2010-04-30 19:16:22 +00:00
|
|
|
index 1040e8b..c4eb59a 100644
|
2010-04-29 19:44:43 +00:00
|
|
|
--- a/mount.cifs.c
|
|
|
|
+++ b/mount.cifs.c
|
2010-04-30 19:16:22 +00:00
|
|
|
@@ -1169,6 +1169,9 @@ static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info
|
2010-04-29 19:44:43 +00:00
|
|
|
}
|
|
|
|
|
2010-04-30 19:16:22 +00:00
|
|
|
prepath = share + sharelen;
|
|
|
|
+ if (*prepath != '\0')
|
|
|
|
+ prepath++;
|
|
|
|
+
|
2010-04-29 19:44:43 +00:00
|
|
|
prepathlen = strlen(prepath);
|
|
|
|
|
|
|
|
if (prepathlen + 1 > sizeof(parsed_info->prefix)) {
|
2010-04-30 19:16:22 +00:00
|
|
|
@@ -1669,6 +1672,7 @@ int main(int argc, char **argv)
|
2010-04-29 19:44:43 +00:00
|
|
|
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)) +
|
2010-04-30 19:16:22 +00:00
|
|
|
@@ -1684,6 +1688,7 @@ int main(int argc, char **argv)
|
2010-04-29 19:44:43 +00:00
|
|
|
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;
|
|
|
|
--
|
|
|
|
1.6.6.1
|
|
|
|
|