samba_gpoupdate: Rename the command to samba-gpupdate
[nivanova/samba-autobuild/.git] / source3 / param / loadparm.c
index 433727b3f7982ff9f6b51d7144938990a539ce4d..8f2f26a4d76e6cf3641a669f218e5c63a7edf1dd 100644 (file)
@@ -111,7 +111,7 @@ static bool defaults_saved = false;
 static struct loadparm_global Globals;
 
 /* This is a default service used to prime a services structure */
-static struct loadparm_service sDefault =
+static const struct loadparm_service _sDefault =
 {
        .valid = true,
        .autoloaded = false,
@@ -193,7 +193,7 @@ static struct loadparm_service sDefault =
        .map_system = false,
        .map_hidden = false,
        .map_archive = true,
-       .store_dos_attributes = false,
+       .store_dos_attributes = true,
        .dmapi_support = false,
        .locking = true,
        .strict_locking = Auto,
@@ -229,26 +229,32 @@ static struct loadparm_service sDefault =
        .nt_acl_support = true,
        .force_unknown_acl_user = false,
        ._use_sendfile = false,
-       .profile_acls = false,
        .map_acl_inherit = false,
        .afs_share = false,
-       .ea_support = false,
+       .ea_support = true,
        .acl_check_permissions = true,
        .acl_map_full_control = true,
        .acl_group_control = false,
        .acl_allow_execute_always = false,
        .allocation_roundup_size = SMB_ROUNDUP_ALLOCATION_SIZE,
-       .aio_read_size = 0,
-       .aio_write_size = 0,
-       .map_readonly = MAP_READONLY_YES,
+       .aio_read_size = 1,
+       .aio_write_size = 1,
+       .map_readonly = MAP_READONLY_NO,
        .directory_name_cache_size = 100,
        .smb_encrypt = SMB_SIGNING_DEFAULT,
        .kernel_share_modes = true,
        .durable_handles = true,
+       .check_parent_directory_delete_on_close = false,
        .param_opt = NULL,
        .dummy = ""
 };
 
+/*
+ * This is a copy of the default service structure. Service options in the
+ * global section would otherwise overwrite the initial default values.
+ */
+static struct loadparm_service sDefault;
+
 /* local variables */
 static struct loadparm_service **ServicePtrs = NULL;
 static int iNumServices = 0;
@@ -646,10 +652,10 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
        Globals._client_ipc_min_protocol = PROTOCOL_DEFAULT;
        Globals._security = SEC_AUTO;
        Globals.encrypt_passwords = true;
-       Globals.client_schannel = Auto;
+       Globals.client_schannel = true;
        Globals.winbind_sealed_pipes = true;
        Globals.require_strong_key = true;
-       Globals.server_schannel = Auto;
+       Globals.server_schannel = true;
        Globals.read_raw = true;
        Globals.write_raw = true;
        Globals.null_passwords = false;
@@ -812,12 +818,12 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
        Globals.winbind_enum_users = false;
        Globals.winbind_enum_groups = false;
        Globals.winbind_use_default_domain = false;
-       Globals.winbind_trusted_domains_only = false;
        Globals.winbind_nested_groups = true;
        Globals.winbind_expand_groups = 0;
        Globals.winbind_nss_info = str_list_make_v3_const(NULL, "template", NULL);
        Globals.winbind_refresh_tickets = false;
        Globals.winbind_offline_logon = false;
+       Globals.winbind_scan_trusted_domains = true;
 
        Globals.idmap_cache_time = 86400 * 7; /* a week by default */
        Globals.idmap_negative_cache_time = 120; /* 2 minutes by default */
@@ -826,7 +832,6 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 
        Globals.name_cache_timeout = 660; /* In seconds */
 
-       Globals.use_spnego = true;
        Globals.client_use_spnego = true;
 
        Globals.client_signing = SMB_SIGNING_DEFAULT;
@@ -861,7 +866,6 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 
        Globals.min_receivefile_size = 0;
 
-       Globals.map_untrusted_to_domain = Auto;
        Globals.multicast_dns_register = true;
 
        Globals.smb2_max_read = DEFAULT_SMB2_MAX_READ;
@@ -913,13 +917,15 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
        Globals.dns_update_command = str_list_make_v3_const(NULL, s, NULL);
        TALLOC_FREE(s);
 
-       s = talloc_asprintf(talloc_tos(), "%s/samba_gpoupdate", get_dyn_SCRIPTSBINDIR());
+       s = talloc_asprintf(talloc_tos(), "%s/samba-gpupdate", get_dyn_SCRIPTSBINDIR());
        if (s == NULL) {
                smb_panic("init_globals: ENOMEM");
        }
        Globals.gpo_update_command = str_list_make_v3_const(NULL, s, NULL);
        TALLOC_FREE(s);
 
+       Globals.apply_group_policies = false;
+
        s = talloc_asprintf(talloc_tos(), "%s/samba_spnupdate", get_dyn_SCRIPTSBINDIR());
        if (s == NULL) {
                smb_panic("init_globals: ENOMEM");
@@ -975,7 +981,7 @@ static struct loadparm_context *setup_lp_context(TALLOC_CTX *mem_ctx)
                return NULL;
        }
 
-       *lp_ctx->sDefault = sDefault;
+       *lp_ctx->sDefault = _sDefault;
        lp_ctx->services = NULL; /* We do not want to access this directly */
        lp_ctx->bInGlobalSection = bInGlobalSection;
        lp_ctx->flags = flags_list;
@@ -1607,7 +1613,7 @@ static bool lp_add_ipc(const char *ipc_name, bool guest_ok)
        ServicePtrs[i]->guest_ok = guest_ok;
        ServicePtrs[i]->printable = false;
        ServicePtrs[i]->browseable = sDefault.browseable;
-       ServicePtrs[i]->autoloaded = true;
+       ServicePtrs[i]->autoloaded = false;
 
        DEBUG(3, ("adding IPC service\n"));
 
@@ -1827,8 +1833,8 @@ static bool is_synonym_of(int parm1, int parm2, bool *inverse)
 
 static void show_parameter(int parmIndex)
 {
-       int enumIndex, flagIndex;
-       int parmIndex2;
+       size_t enumIndex, flagIndex;
+       size_t parmIndex2;
        bool hadFlag;
        bool hadSyn;
        bool inverse;
@@ -3865,6 +3871,7 @@ static bool lp_load_ex(const char *pszFname,
        bInGlobalSection = true;
        bGlobalOnly = global_only;
        bAllowIncludeRegistry = allow_include_registry;
+       sDefault = _sDefault;
 
        lp_ctx = setup_lp_context(talloc_tos());