s3-auth: Remove security=share (depricated since 3.6).
[kai/samba.git] / source3 / param / loadparm.c
index 1310353348e881933bc84954f60e6b93fdf62dab..453c8fd875970f54c7c385f5f7a582fbef4eaff1 100644 (file)
@@ -934,15 +934,6 @@ static struct parm_struct parm_table[] = {
                .enum_list      = NULL,
                .flags          = FLAG_ADVANCED,
        },
-       {
-               .label          = "send spnego principal",
-               .type           = P_BOOL,
-               .p_class        = P_GLOBAL,
-               .offset         = GLOBAL_VAR(send_spnego_principal),
-               .special        = NULL,
-               .enum_list      = NULL,
-               .flags          = FLAG_ADVANCED,
-       },
        {
                .label          = "username",
                .type           = P_STRING,
@@ -1558,7 +1549,16 @@ static struct parm_struct parm_table[] = {
                .label          = "max protocol",
                .type           = P_ENUM,
                .p_class        = P_GLOBAL,
-               .offset         = GLOBAL_VAR(maxprotocol),
+               .offset         = GLOBAL_VAR(srv_maxprotocol),
+               .special        = NULL,
+               .enum_list      = enum_protocol,
+               .flags          = FLAG_ADVANCED,
+       },
+       {
+               .label          = "server max protocol",
+               .type           = P_ENUM,
+               .p_class        = P_GLOBAL,
+               .offset         = GLOBAL_VAR(srv_maxprotocol),
                .special        = NULL,
                .enum_list      = enum_protocol,
                .flags          = FLAG_ADVANCED,
@@ -1567,7 +1567,7 @@ static struct parm_struct parm_table[] = {
                .label          = "protocol",
                .type           = P_ENUM,
                .p_class        = P_GLOBAL,
-               .offset         = GLOBAL_VAR(maxprotocol),
+               .offset         = GLOBAL_VAR(srv_maxprotocol),
                .special        = NULL,
                .enum_list      = enum_protocol,
                .flags          = FLAG_ADVANCED,
@@ -1576,7 +1576,16 @@ static struct parm_struct parm_table[] = {
                .label          = "min protocol",
                .type           = P_ENUM,
                .p_class        = P_GLOBAL,
-               .offset         = GLOBAL_VAR(minprotocol),
+               .offset         = GLOBAL_VAR(srv_minprotocol),
+               .special        = NULL,
+               .enum_list      = enum_protocol,
+               .flags          = FLAG_ADVANCED,
+       },
+       {
+               .label          = "server min protocol",
+               .type           = P_ENUM,
+               .p_class        = P_GLOBAL,
+               .offset         = GLOBAL_VAR(srv_minprotocol),
                .special        = NULL,
                .enum_list      = enum_protocol,
                .flags          = FLAG_ADVANCED,
@@ -4757,8 +4766,8 @@ static void init_globals(bool reinit_globals)
        Globals.max_log_size = 5000;
        Globals.max_open_files = max_open_files();
        Globals.open_files_db_hash_size = SMB_OPEN_DATABASE_TDB_HASH_SIZE;
-       Globals.maxprotocol = PROTOCOL_NT1;
-       Globals.minprotocol = PROTOCOL_CORE;
+       Globals.srv_maxprotocol = PROTOCOL_NT1;
+       Globals.srv_minprotocol = PROTOCOL_CORE;
        Globals.security = SEC_USER;
        Globals.paranoid_server_security = true;
        Globals.bEncryptPasswords = true;
@@ -5258,7 +5267,6 @@ FN_GLOBAL_BOOL(lp_unix_extensions, bUnixExtensions)
 FN_GLOBAL_BOOL(lp_use_spnego, bUseSpnego)
 FN_GLOBAL_BOOL(lp_client_use_spnego, bClientUseSpnego)
 FN_GLOBAL_BOOL(lp_client_use_spnego_principal, client_use_spnego_principal)
-FN_GLOBAL_BOOL(lp_send_spnego_principal, send_spnego_principal)
 FN_GLOBAL_BOOL(lp_hostname_lookups, bHostnameLookups)
 FN_GLOBAL_CONST_STRING(lp_dedicated_keytab_file, szDedicatedKeytabFile)
 FN_GLOBAL_INTEGER(lp_kerberos_method, iKerberosMethod)
@@ -5278,19 +5286,8 @@ FN_GLOBAL_INTEGER(lp_passwordlevel, pwordlevel)
 FN_GLOBAL_INTEGER(lp_usernamelevel, unamelevel)
 FN_GLOBAL_INTEGER(lp_deadtime, deadtime)
 FN_GLOBAL_BOOL(lp_getwd_cache, getwd_cache)
-static FN_GLOBAL_INTEGER(_lp_maxprotocol, maxprotocol)
-int lp_maxprotocol(void)
-{
-       int ret = _lp_maxprotocol();
-       if ((ret >= PROTOCOL_SMB2_02) && (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, minprotocol)
+FN_GLOBAL_INTEGER(lp_srv_maxprotocol, srv_maxprotocol)
+FN_GLOBAL_INTEGER(lp_srv_minprotocol, srv_minprotocol)
 FN_GLOBAL_INTEGER(lp_security, security)
 FN_GLOBAL_LIST(lp_auth_methods, AuthMethods)
 FN_GLOBAL_BOOL(lp_paranoid_server_security, paranoid_server_security)
@@ -6474,6 +6471,7 @@ static void copy_service(struct loadparm_service *pserviceDest, struct loadparm_
                                case P_INTEGER:
                                case P_ENUM:
                                case P_OCTAL:
+                               case P_BYTES:
                                        *(int *)dest_ptr = *(int *)src_ptr;
                                        break;
 
@@ -8504,9 +8502,8 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i
 
                if (NT_STATUS_IS_OK(status) &&
                    (data.dptr != NULL) &&
-                   (data.dsize == sizeof(iService)))
-               {
-                       iService = *(int *)data.dptr;
+                   (data.dsize == sizeof(iService))) {
+                       memcpy(&iService, data.dptr, sizeof(iService));
                }
        }
 
@@ -9042,9 +9039,7 @@ static bool lp_load_ex(const char *pszFname,
 
        set_allowed_client_auth();
 
-       if (lp_security() == SEC_SHARE) {
-               DEBUG(1, ("WARNING: The security=share option is deprecated\n"));
-       } else if (lp_security() == SEC_SERVER) {
+       if (lp_security() == SEC_SERVER) {
                DEBUG(1, ("WARNING: The security=server option is deprecated\n"));
        }
 
@@ -9266,11 +9261,6 @@ int lp_servicenumber(const char *pszServiceName)
        return (iService);
 }
 
-bool share_defined(const char *service_name)
-{
-       return (lp_servicenumber(service_name) != -1);
-}
-
 /*******************************************************************
  A useful volume label function. 
 ********************************************************************/