s3-param use Auto define for lm_announce default
[kai/samba-autobuild/.git] / source3 / param / loadparm.c
index 21fa662141bd69addc6f2ab8cbdba7081290c69c..345f7483842738038dc5f2e9feebb0466d21d4b0 100644 (file)
@@ -3899,6 +3899,15 @@ static struct parm_struct parm_table[] = {
                .enum_list      = NULL,
                .flags          = FLAG_ADVANCED | FLAG_SHARE,
        },
+       {
+               .label          = "allow insecure wide links",
+               .type           = P_BOOL,
+               .p_class        = P_GLOBAL,
+               .offset         = GLOBAL_VAR(bAllowInsecureWidelinks),
+               .special        = NULL,
+               .enum_list      = NULL,
+               .flags          = FLAG_ADVANCED,
+       },
        {
                .label          = "wide links",
                .type           = P_BOOL,
@@ -4825,7 +4834,7 @@ static void init_globals(bool reinit_globals)
        Globals.max_wins_ttl = 60 * 60 * 24 * 6;        /* 6 days default. */
        Globals.min_wins_ttl = 60 * 60 * 6;     /* 6 hours default. */
        Globals.machine_password_timeout = 60 * 60 * 24 * 7;    /* 7 days default. */
-       Globals.lm_announce = 2;        /* = Auto: send only if LM clients found */
+       Globals.lm_announce = Auto;     /* = Auto: send only if LM clients found */
        Globals.lm_interval = 60;
 #if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT))
        Globals.bNISHomeMap = false;
@@ -5390,6 +5399,7 @@ FN_GLOBAL_INTEGER(lp_ctdb_timeout, ctdb_timeout)
 FN_GLOBAL_INTEGER(lp_ctdb_locktime_warn_threshold, ctdb_locktime_warn_threshold)
 FN_GLOBAL_BOOL(lp_async_smb_echo_handler, bAsyncSMBEchoHandler)
 FN_GLOBAL_BOOL(lp_multicast_dns_register, bMulticastDnsRegister)
+FN_GLOBAL_BOOL(lp_allow_insecure_widelinks, bAllowInsecureWidelinks)
 FN_GLOBAL_INTEGER(lp_winbind_cache_time, winbind_cache_time)
 FN_GLOBAL_INTEGER(lp_winbind_reconnect_delay, winbind_reconnect_delay)
 FN_GLOBAL_INTEGER(lp_winbind_max_clients, winbind_max_clients)
@@ -8989,7 +8999,10 @@ static bool lp_load_ex(const char *pszFname,
                lp_save_defaults();
        }
 
-       free_param_opts(&Globals.param_opt);
+       if (!initialize_globals) {
+               free_param_opts(&Globals.param_opt);
+               apply_lp_set_cmdline();
+       }
 
        lp_do_parameter(-1, "idmap config * : backend", Globals.szIdmapBackend);
 
@@ -9634,6 +9647,10 @@ static bool lp_widelinks_internal(int snum)
 
 void widelinks_warning(int snum)
 {
+       if (lp_allow_insecure_widelinks()) {
+               return;
+       }
+
        if (lp_unix_extensions() && lp_widelinks_internal(snum)) {
                DEBUG(0,("Share '%s' has wide links and unix extensions enabled. "
                        "These parameters are incompatible. "
@@ -9646,7 +9663,13 @@ bool lp_widelinks(int snum)
 {
        /* wide links is always incompatible with unix extensions */
        if (lp_unix_extensions()) {
-               return false;
+               /*
+                * Unless we have "allow insecure widelinks"
+                * turned on.
+                */
+               if (!lp_allow_insecure_widelinks()) {
+                       return false;
+               }
        }
 
        return lp_widelinks_internal(snum);