Print this page
NEX-14666 Need to provide SMB 2.1 Client
NEX-17187 panic in smbfs_acl_store
NEX-17231 smbfs create xattr files finds wrong file
NEX-17224 smbfs lookup EINVAL should be ENOENT
NEX-17260 SMB1 client fails to list directory after NEX-14666
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
and: (cleanup)
4295 libshare sa_get_proto_status sometimes returns unallocated strings
Reviewed by: Marcel Telka <marcel@telka.sk>
Approved by: Garrett D'Amore <garrett@damore.org>

@@ -20,10 +20,12 @@
  */
 
 /*
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  */
 
 /*
  * SMB specific functions
  */

@@ -68,10 +70,11 @@
 static int string_length_check_validator(int, char *, char *);
 static int yes_no_validator(int, char *, char *);
 static int ip_address_validator(int, char *, char *);
 static int minauth_validator(int, char *, char *);
 static int password_validator(int, char *, char *);
+static int protocol_validator(int, char *, char *);
 static int signing_validator(int, char *, char *);
 
 int propset_changed = 0;
 
 /*

@@ -180,10 +183,16 @@
             0, 0, MAX_VALUE_BUFLEN,
             string_length_check_validator},
         { "signing", NULL, PROTO_OPT_SIGNING,
             0, 0, MAX_VALUE_BUFLEN,
             signing_validator},
+        { "min_protocol", NULL, PROTO_OPT_MIN_PROTOCOL,
+            0, 0, MAX_VALUE_BUFLEN,
+            protocol_validator},
+        { "max_protocol", NULL, PROTO_OPT_MAX_PROTOCOL,
+            0, 0, MAX_VALUE_BUFLEN,
+            protocol_validator},
         {NULL}
 };
 
 /*
  * Check the range of value as int range.

@@ -268,22 +277,34 @@
 
 /*ARGSUSED*/
 static int
 minauth_validator(int index, char *section, char *value)
 {
+        int ival;
+
         if (value == NULL)
                 return (SA_BAD_VALUE);
-        if (strlen(value) == 0)
+        ival = smb_cf_minauth_from_str(value);
+        if (ival == -1)
+                return (SA_BAD_VALUE);
+
                 return (SA_OK);
-        if (strcmp(value, "kerberos") == 0 ||
-            strcmp(value, "ntlmv2") == 0 ||
-            strcmp(value, "ntlm") == 0 ||
-            strcmp(value, "lm") == 0 ||
-            strcmp(value, "none") == 0)
-                return (SA_OK);
-        else
+}
+
+/*ARGSUSED*/
+static int
+protocol_validator(int index, char *section, char *value)
+{
+        int ival;
+
+        if (value == NULL)
                 return (SA_BAD_VALUE);
+        ival = smb_cf_version_from_str(value);
+        if (ival == -1)
+                return (SA_BAD_VALUE);
+
+        return (SA_OK);
 }
 
 /*ARGSUSED*/
 static int
 signing_validator(int index, char *section, char *value)