mount.cifs: fix ver= option passed to the kernel
authorJeff Layton <jlayton@redhat.com>
Tue, 23 Mar 2010 13:21:25 +0000 (09:21 -0400)
committerJeff Layton <jlayton@redhat.com>
Tue, 23 Mar 2010 13:21:25 +0000 (09:21 -0400)
Rather than passing the VERSION string to the kernel in the ver=
option, track the OPTIONS_VERSION separately and pass that to the
kernel. If we ever need to have different behavior in kernel for
different mount.cifs versions, we can bump this number.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
mount.cifs.c

index 312b34a979390b34a39429ea011fdf94a20d8319..4211b4d12710a6bf080eed7ef9b3ec37b3b67534 100644 (file)
 /* currently maximum length of IPv6 address string */
 #define MAX_ADDRESS_LEN INET6_ADDRSTRLEN
 
+/*
+ * 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.
@@ -1503,7 +1509,7 @@ mount_retry:
        }
 
        strlcat(options,",ver=",options_size);
-       strlcat(options,VERSION,options_size);
+       strlcat(options,OPTIONS_VERSION,options_size);
 
        if(orgoptions) {
                strlcat(options,",",options_size);