1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/lib/param/s3_param.h
Andreas Schneider d7a6488da8 lib:param: Set a memory context for the globals if not initialized yet
Typically once the smb.conf starts to be loaded,
loadparm_s3_init_globals() will be called and a memory context for
strings on the static Globals will be created.  But we might call
lpcfg_set_cmdline() before we load the smb.conf file, so we (via a
helper pointer) call loadparm_s3_init_globals() to get that
initialisation done earlier, ensuring that all allocations on Globals is
done on a memory context that we can later TALLOC_FREE() before exit().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-25 22:23:37 +00:00

24 lines
931 B
C

#ifndef __S3_PARAM_H__
#define __S3_PARAM_H__
struct loadparm_s3_helpers
{
void * (*get_parm_ptr)(struct loadparm_service *service, struct parm_struct *parm);
struct loadparm_service * (*get_service)(const char *service_name);
struct loadparm_service * (*get_servicebynum)(int snum);
int (*getservicebyname)(const char *, struct loadparm_service *);
int (*get_numservices)(void);
bool (*load)(const char *filename);
bool (*store_cmdline)(const char *pszParmName, const char *pszParmValue);
void (*dump)(FILE *f, bool show_defaults, int maxtoprint);
bool (*lp_include)(struct loadparm_context*, struct loadparm_service *,
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;
};
#endif /* __S3_PARAM_H__ */