Change "security=share" to downgrade to SMB1 from SMB2, rather than trying to fake it.
authorJeremy Allison <jra@samba.org>
Thu, 27 Jan 2011 23:00:14 +0000 (15:00 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 27 Jan 2011 23:26:47 +0000 (15:26 -0800)
source3/param/loadparm.c
source3/smbd/smb2_server.c

index b45e045d6466b88eb2e80662c491589075cb63c6..3abebf47143e898e42260f5e8c3792d9747dd1ad 100644 (file)
@@ -5789,7 +5789,18 @@ FN_GLOBAL_INTEGER(lp_passwordlevel, &Globals.pwordlevel)
 FN_GLOBAL_INTEGER(lp_usernamelevel, &Globals.unamelevel)
 FN_GLOBAL_INTEGER(lp_deadtime, &Globals.deadtime)
 FN_GLOBAL_BOOL(lp_getwd_cache, &Globals.getwd_cache)
-FN_GLOBAL_INTEGER(lp_maxprotocol, &Globals.maxprotocol)
+FN_GLOBAL_INTEGER(_lp_maxprotocol, &Globals.maxprotocol)
+int lp_maxprotocol(void)
+{
+       int ret = _lp_maxprotocol();
+       if ((ret == PROTOCOL_SMB2) && (lp_security() == SEC_SHARE)) {
+               DEBUG(2,("WARNING!!: \"security = share\" is incompatible "
+                       "with the SMB2 protocol. Resetting to SMB1.\n" ));
+                       lp_do_parameter(-1, "max protocol", "NT1");
+               return PROTOCOL_NT1;
+       }
+       return ret;
+}
 FN_GLOBAL_INTEGER(lp_minprotocol, &Globals.minprotocol)
 FN_GLOBAL_INTEGER(lp_security, &Globals.security)
 FN_GLOBAL_LIST(lp_auth_methods, &Globals.AuthMethods)
index fef9dede261c109ee7be3bfbf3ecfc1cc63eafa8..fc2af475f2d3140aaea85999e1aae710f11b2421 100644 (file)
@@ -2169,14 +2169,6 @@ void smbd_smb2_first_negprot(struct smbd_server_connection *sconn,
        struct smbd_smb2_request *req = NULL;
        struct tevent_req *subreq;
 
-       if (lp_security() == SEC_SHARE) {
-               DEBUG(2,("WARNING!!: \"security = share\" is deprecated for "
-                       "SMB2 servers. Mapping to \"security = user\" and "
-                       "\"map to guest = Bad User\"\n" ));
-               lp_do_parameter(-1, "security", "user");
-               lp_do_parameter(-1, "map to guest", "Bad User");
-       }
-
        DEBUG(10,("smbd_smb2_first_negprot: packet length %u\n",
                 (unsigned int)size));