From af31bf6bf5ef3af6eaf87ebe2f9f5903698c22db Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 29 Mar 2011 14:41:58 +1100 Subject: debug: ignore debug_set_logfile() with a blank string Pair-Programmed-With: Andrew Bartlett Autobuild-User: Andrew Tridgell Autobuild-Date: Tue Mar 29 07:03:58 CEST 2011 on sn-devel-104 --- lib/util/debug.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/util/debug.c b/lib/util/debug.c index c7ba19e3cc..2ff7cb2c58 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -493,6 +493,10 @@ void setup_logging(const char *prog_name, enum debug_logtype new_logtype) void debug_set_logfile(const char *name) { + if (name == NULL || *name == 0) { + /* this copes with calls when smb.conf is not loaded yet */ + return; + } TALLOC_FREE(state.debugf); state.debugf = talloc_strdup(NULL, name); } @@ -564,7 +568,7 @@ bool reopen_logs_internal(void) if (new_fd == -1) { log_overflow = true; - DEBUG(0, ("Unable to open new log file %s: %s\n", state.debugf, strerror(errno))); + DEBUG(0, ("Unable to open new log file '%s': %s\n", state.debugf, strerror(errno))); log_overflow = false; ret = false; } else { -- cgit