}
/**
- * Initialise the global parameter structure.
+ * @brief Initialise the global parameter structure.
+ *
+ * This function initialized the globals if needed. Make sure that
+ * gfree_loadparm() is called before the application exits.
+ *
+ * @param mem_ctx The talloc memory context to allocate lp_ctx on.
+ *
+ * @param s3_fns The loadparm helper functions to use
+ *
+ * @return An initialized lp_ctx pointer or NULL on error.
*/
struct loadparm_context *loadparm_init_s3(TALLOC_CTX *mem_ctx,
const struct loadparm_s3_helpers *s3_fns)
loadparm_context->globals = s3_fns->globals;
loadparm_context->flags = s3_fns->flags;
+ /* Make sure globals are correctly initialized */
+ loadparm_context->s3_fns->init_globals(loadparm_context, false);
+
return loadparm_context;
}
const char *, char **);
void (*init_ldap_debugging)(void);
bool (*do_section)(const char *pszSectionName, void *userdata);
+ void (*init_globals)(struct loadparm_context *lp_ctx, bool reinit_globals);
struct loadparm_global *globals;
unsigned int *flags;
};
-/*
+/*
Unix SMB/CIFS implementation.
Parameter loading functions
Copyright (C) Andrew Bartlett 2011
.lp_include = lp_include,
.init_ldap_debugging = init_ldap_debugging,
.do_section = lp_do_section,
+ .init_globals = loadparm_s3_init_globals,
};
const struct loadparm_s3_helpers *loadparm_s3_helpers(void)