int ldap_passwd_sync;
int ldap_replication_sleep;
int ldap_timeout; /* This is initialised in init_globals */
+ int ldap_connection_timeout;
int ldap_page_size;
bool ldap_delete_dn;
bool bMsAddPrinterWizard;
.enum_list = NULL,
.flags = FLAG_ADVANCED,
},
+ {
+ .label = "ldap connection timeout",
+ .type = P_INTEGER,
+ .p_class = P_GLOBAL,
+ .ptr = &Globals.ldap_connection_timeout,
+ .special = NULL,
+ .enum_list = NULL,
+ .flags = FLAG_ADVANCED,
+ },
{
.label = "ldap page size",
.type = P_INTEGER,
Globals.ldap_passwd_sync = LDAP_PASSWD_SYNC_OFF;
Globals.ldap_delete_dn = False;
Globals.ldap_replication_sleep = 1000; /* wait 1 sec for replication */
- Globals.ldap_timeout = LDAP_CONNECT_DEFAULT_TIMEOUT;
+ Globals.ldap_timeout = LDAP_DEFAULT_TIMEOUT;
+ Globals.ldap_connection_timeout = LDAP_CONNECTION_DEFAULT_TIMEOUT;
Globals.ldap_page_size = LDAP_PAGE_SIZE;
Globals.ldap_debug_level = 0;
FN_GLOBAL_BOOL(lp_ldap_delete_dn, &Globals.ldap_delete_dn)
FN_GLOBAL_INTEGER(lp_ldap_replication_sleep, &Globals.ldap_replication_sleep)
FN_GLOBAL_INTEGER(lp_ldap_timeout, &Globals.ldap_timeout)
+FN_GLOBAL_INTEGER(lp_ldap_connection_timeout, &Globals.ldap_connection_timeout)
FN_GLOBAL_INTEGER(lp_ldap_page_size, &Globals.ldap_page_size)
FN_GLOBAL_INTEGER(lp_ldap_debug_level, &Globals.ldap_debug_level)
FN_GLOBAL_INTEGER(lp_ldap_debug_threshold, &Globals.ldap_debug_threshold)
}
while (data) {
- if (strcmp(data->key, param_key) == 0) {
+ if (strcasecmp(data->key, param_key) == 0) {
string_free(¶m_key);
return data;
}
return false;
}
+ ret = do_section(service->name, NULL);
+ if (ret != true) {
+ return false;
+ }
for (count = 0; count < service->num_params; count++) {
ret = do_parameter(service->param_names[count],
service->param_values[count],
goto done;
}
+ ret = do_parameter("registry shares", "yes", NULL);
+ if (!ret) {
+ goto done;
+ }
+
if (!smbconf_share_exists(conf_ctx, GLOBAL_NAME)) {
/* nothing to read from the registry yet but make sure lp_load
* doesn't return false */
goto done;
}
- ret = do_parameter("registry shares", "yes", NULL);
+ /* store the csn */
+ smbconf_changed(conf_ctx, &conf_last_csn, NULL, NULL);
+
+done:
+ TALLOC_FREE(mem_ctx);
+ return ret;
+}
+
+static bool process_registry_shares(void)
+{
+ WERROR werr;
+ uint32_t count;
+ struct smbconf_service **service = NULL;
+ uint32_t num_shares = 0;
+ TALLOC_CTX *mem_ctx = talloc_stackframe();
+ struct smbconf_ctx *conf_ctx = lp_smbconf_ctx();
+ bool ret = false;
+
+ if (conf_ctx == NULL) {
+ goto done;
+ }
+
+ werr = smbconf_get_config(conf_ctx, mem_ctx, &num_shares, &service);
+ if (!W_ERROR_IS_OK(werr)) {
+ goto done;
+ }
+
+ ret = true;
+
+ for (count = 0; count < num_shares; count++) {
+ if (strequal(service[count]->name, GLOBAL_NAME)) {
+ continue;
+ }
+ ret = process_registry_service(service[count]);
+ if (!ret) {
+ goto done;
+ }
+ }
+
/* store the csn */
smbconf_changed(conf_ctx, &conf_last_csn, NULL, NULL);
DEBUG(2, ("Can't find include file %s\n", fname));
SAFE_FREE(fname);
- return false;
+ return true;
}
/***************************************************************************
/* if it is a special case then go ahead */
if (parm_table[parmnum].special) {
- parm_table[parmnum].special(snum, pszParmValue, (char **)parm_ptr);
- return (True);
+ return parm_table[parmnum].special(snum, pszParmValue,
+ (char **)parm_ptr);
}
/* now switch on the type of variable it is */
bool save_defaults,
bool add_ipc,
bool initialize_globals,
- bool allow_include_registry)
+ bool allow_include_registry,
+ bool allow_registry_shares)
{
char *n2 = NULL;
bool bRetval;
lp_save_defaults();
}
+ /* We get sections first, so have to start 'behind' to make up */
+ iServiceIndex = -1;
+
if (Globals.param_opt != NULL) {
data = Globals.param_opt;
while (data) {
add_to_file_list(pszFname, n2);
- /* We get sections first, so have to start 'behind' to make up */
- iServiceIndex = -1;
bRetval = pm_process(n2, do_section, do_parameter, NULL);
SAFE_FREE(n2);
lp_kill_all_services();
return lp_load_ex(pszFname, global_only, save_defaults,
add_ipc, initialize_globals,
- allow_include_registry);
+ allow_include_registry,
+ allow_registry_shares);
}
} else if (lp_config_backend_is_registry()) {
bRetval = process_registry_globals();
bRetval = false;
}
+ if (bRetval && lp_registry_shares() && allow_registry_shares) {
+ bRetval = process_registry_shares();
+ }
+
lp_add_auto_services(lp_auto_services());
if (add_ipc) {
save_defaults,
add_ipc,
initialize_globals,
- true);
+ true, false);
}
bool lp_load_initial_only(const char *pszFname)
false,
false,
true,
+ false,
false);
}
+bool lp_load_with_registry_shares(const char *pszFname,
+ bool global_only,
+ bool save_defaults,
+ bool add_ipc,
+ bool initialize_globals)
+{
+ return lp_load_ex(pszFname,
+ global_only,
+ save_defaults,
+ add_ipc,
+ initialize_globals,
+ true,
+ true);
+}
+
/***************************************************************************
Reset the max number of services.
***************************************************************************/