#include "../librpc/gen_ndr/svcctl.h"
#include "intl.h"
#include "smb_signing.h"
-#include "dbwrap.h"
+#include "dbwrap/dbwrap.h"
#include "smbldap.h"
#include "../lib/util/bitmap.h"
static void add_to_file_list(const char *fname, const char *subfname);
static bool lp_set_cmdline_helper(const char *pszParmName, const char *pszParmValue, bool store_values);
+static void free_param_opts(struct parmlist_entry **popts);
static const struct enum_list enum_protocol[] = {
- {PROTOCOL_SMB2_02, "SMB2"},
+ {PROTOCOL_SMB2_02, "SMB2"}, /* for now keep PROTOCOL_SMB2_02 */
+ {PROTOCOL_SMB2_10, "SMB2_10"},
{PROTOCOL_SMB2_02, "SMB2_02"},
{PROTOCOL_NT1, "NT1"},
{PROTOCOL_LANMAN2, "LANMAN2"},
*/
static void free_global_parameters(void)
{
+ free_param_opts(&Globals.param_opt);
free_parameters_by_snum(GLOBAL_SECTION_SNUM);
}
* wipe out smb.conf options set with lp_set_cmdline(). The
* apply_lp_set_cmdline() call puts these values back in the
* table once the defaults are set */
- memset((void *)&Globals, '\0', sizeof(Globals));
+ ZERO_STRUCT(Globals);
for (i = 0; parm_table[i].label; i++) {
if ((parm_table[i].type == P_STRING ||
static void init_copymap(struct loadparm_service *pservice);
static bool hash_a_service(const char *name, int number);
static void free_service_byindex(int iService);
-static void free_param_opts(struct parmlist_entry **popts);
static void show_parameter(int parmIndex);
static bool is_synonym_of(int parm1, int parm2, bool *inverse);
/***************************************************************************
Allow client apps to specify that they are a client
***************************************************************************/
-void lp_set_in_client(bool b)
+static void lp_set_in_client(bool b)
{
in_client = b;
}
{
lp_set_in_client(true);
- return lp_load_global_only(file_name);
+ return lp_load_global(file_name);
+}
+
+/**
+ * lp_load wrapper, loading only globals, but intended
+ * for subsequent calls, not reinitializing the globals
+ * to default values
+ */
+bool lp_load_global_no_reinit(const char *file_name)
+{
+ return lp_load_ex(file_name,
+ true, /* global_only */
+ false, /* save_defaults */
+ false, /* add_ipc */
+ false, /* initialize_globals */
+ true, /* allow_include_registry */
+ false); /* load_all_shares*/
+}
+
+/**
+ * lp_load wrapper, especially for clients, no reinitialization
+ */
+bool lp_load_client_no_reinit(const char *file_name)
+{
+ lp_set_in_client(true);
+
+ return lp_load_global_no_reinit(file_name);
}
bool lp_load_with_registry_shares(const char *pszFname,