All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mount.cifs: don't send a mandatory ver= option to the kernel
@ 2012-05-11 19:03 Jeff Layton
       [not found] ` <1336763001-7315-1-git-send-email-jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Jeff Layton @ 2012-05-11 19:03 UTC (permalink / raw)
  To: linux-cifs-u79uwXL29TY76Z2rM5mHXA

Traditionally, this ver= option was used to specify the "options
version" that we're passing in. It has always been set to '1' though
and we have never changed that.

Eventually we want to have a ver= (or vers=) option that allows users
to specify the SMB version that they want to use to talk to the server.

At that point, this option will just get in the way. Let's go ahead
and remove it now in preparation for that day.

Signed-off-by: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
---
 mount.cifs.c |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/mount.cifs.c b/mount.cifs.c
index 0408158..3041987 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -100,12 +100,6 @@
 #define MAX_DOMAIN_SIZE 64
 
 /*
- * value of the ver= option that gets passed to the kernel. Used to indicate
- * behavioral changes introduced in the mount helper.
- */
-#define OPTIONS_VERSION "1"
-
-/*
  * mount.cifs has been the subject of many "security" bugs that have arisen
  * because of users and distributions installing it as a setuid root program
  * before it had been audited for security holes. The default behavior is
@@ -1833,21 +1827,21 @@ assemble_mountinfo(struct parsed_mount_info *parsed_info,
 			goto assemble_exit;
 	}
 
-	/* copy in ver= string. It's not really needed, but what the hell */
-	if (*parsed_info->options)
-		strlcat(parsed_info->options, ",", sizeof(parsed_info->options));
-	strlcat(parsed_info->options, "ver=", sizeof(parsed_info->options));
-	strlcat(parsed_info->options, OPTIONS_VERSION, sizeof(parsed_info->options));
-
 	/* copy in user= string */
 	if (parsed_info->got_user) {
-		strlcat(parsed_info->options, ",user=",
+		if (*parsed_info->options)
+			strlcat(parsed_info->options, ",",
+				sizeof(parsed_info->options));
+		strlcat(parsed_info->options, "user=",
 			sizeof(parsed_info->options));
 		strlcat(parsed_info->options, parsed_info->username,
 			sizeof(parsed_info->options));
 	}
 
 	if (*parsed_info->domain) {
+		if (*parsed_info->options)
+			strlcat(parsed_info->options, ",",
+				sizeof(parsed_info->options));
 		strlcat(parsed_info->options, ",domain=",
 			sizeof(parsed_info->options));
 		strlcat(parsed_info->options, parsed_info->domain,
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-05-17 18:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-11 19:03 [PATCH] mount.cifs: don't send a mandatory ver= option to the kernel Jeff Layton
     [not found] ` <1336763001-7315-1-git-send-email-jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-05-17 10:48   ` Jeff Layton
2012-05-17 16:44   ` Sachin Prabhu
2012-05-17 17:03     ` Steve French
     [not found]       ` <CAH2r5muvJ=QUt6MsYQiZpZDWp+GRzviJRnJ6Q7O5eE1zYNOnJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-17 17:54         ` Jeff Layton
     [not found]           ` <20120517135437.6af5c851-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2012-05-17 17:58             ` Steve French
     [not found]               ` <CAH2r5mviuR0VK-j-G1h9WBzexji92u5KW5x613Xbvb4rAmB-1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-17 18:25                 ` Jeff Layton
     [not found]                   ` <20120517142532.26ef58f9-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2012-05-17 18:30                     ` Scott Lovenberg
     [not found]                       ` <4FB543D4.4020202-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-05-17 18:32                         ` Steve French

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.