diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-02-24 16:14:03 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-03-01 04:32:12 +0100 |
commit | 5f5ca913b7abfcf95782339fac2dc8c1541b1126 (patch) | |
tree | edd1c797f8d8692ff7d613e7ae8901b656dd6726 /source4/param | |
parent | 4acef317a0e1692afc526a3805adf87403651170 (diff) | |
download | samba-5f5ca913b7abfcf95782339fac2dc8c1541b1126.tar.gz samba-5f5ca913b7abfcf95782339fac2dc8c1541b1126.tar.bz2 samba-5f5ca913b7abfcf95782339fac2dc8c1541b1126.zip |
lib/util: new merged debug system
This is the s3 debug system, with a number of changes to tidy it up
for common use. The debug class system is simplified by the removal of the
ISSET table, the system no longer attempts to cope with assignment of
DEBUGLEVEL, and the full class table is always available (rather than
just DEBUGLEVEL_CLASS[DBCG_ALL]) from startup. It is also no longer
confusingly described as a hack, but as the initial table.
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Mar 1 04:32:12 CET 2011 on sn-devel-104
Diffstat (limited to 'source4/param')
-rw-r--r-- | source4/param/loadparm.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index 31157b2833..186443662a 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -133,6 +133,7 @@ struct loadparm_global char *tls_crlfile; char *tls_dhpfile; char *logfile; + char *loglevel; char *panic_action; int max_mux; int debuglevel; @@ -396,8 +397,8 @@ static struct parm_struct parm_table[] = { {"hosts allow", P_LIST, P_LOCAL, LOCAL_VAR(szHostsallow), NULL, NULL}, {"hosts deny", P_LIST, P_LOCAL, LOCAL_VAR(szHostsdeny), NULL, NULL}, - {"log level", P_INTEGER, P_GLOBAL, GLOBAL_VAR(debuglevel), handle_debuglevel, NULL}, - {"debuglevel", P_INTEGER, P_GLOBAL, GLOBAL_VAR(debuglevel), handle_debuglevel, NULL}, + {"log level", P_STRING, P_GLOBAL, GLOBAL_VAR(loglevel), handle_debuglevel, NULL}, + {"debuglevel", P_STRING, P_GLOBAL, GLOBAL_VAR(loglevel), handle_debuglevel, NULL}, {"log file", P_STRING, P_GLOBAL, GLOBAL_VAR(logfile), handle_logfile, NULL}, {"smb ports", P_LIST, P_GLOBAL, GLOBAL_VAR(smb_ports), NULL, NULL}, @@ -1524,22 +1525,15 @@ static bool handle_copy(struct loadparm_context *lp_ctx, static bool handle_debuglevel(struct loadparm_context *lp_ctx, const char *pszParmValue, char **ptr) { - DEBUGLEVEL = atoi(pszParmValue); - /* also set in the loadparm table, so querying debug level - works */ - *(int *)ptr = DEBUGLEVEL; - - return true; + string_set(lp_ctx, ptr, pszParmValue); + return debug_parse_levels(pszParmValue); } static bool handle_logfile(struct loadparm_context *lp_ctx, const char *pszParmValue, char **ptr) { - if (logfile != NULL) { - free(discard_const_p(char, logfile)); - } - logfile = strdup(pszParmValue); + debug_set_logfile(pszParmValue); string_set(lp_ctx, ptr, pszParmValue); return true; } @@ -2371,6 +2365,11 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx) } } + + lpcfg_do_global_parameter(lp_ctx, "log level", "0"); + + lpcfg_do_global_parameter(lp_ctx, "share backend", "classic"); + lpcfg_do_global_parameter(lp_ctx, "share backend", "classic"); lpcfg_do_global_parameter(lp_ctx, "server role", "standalone"); @@ -2560,6 +2559,7 @@ const char *lp_default_path(void) */ static bool lpcfg_update(struct loadparm_context *lp_ctx) { + struct debug_settings settings; lpcfg_add_auto_services(lp_ctx, lpcfg_auto_services(lp_ctx)); if (!lp_ctx->globals->szWINSservers && lp_ctx->globals->bWINSsupport) { @@ -2570,6 +2570,12 @@ static bool lpcfg_update(struct loadparm_context *lp_ctx) reload_charcnv(lp_ctx); + ZERO_STRUCT(settings); + /* Add any more debug-related smb.conf parameters created in + * future here */ + settings.timestamp_logs = true; + debug_set_settings(&settings); + /* FIXME: ntstatus_check_dos_mapping = lpcfg_nt_status_support(lp_ctx); */ /* FIXME: This is a bit of a hack, but we can't use a global, since |