summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-08-16 15:30:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:21 -0500
commitcc72b666ed93556a2413055f161e67437024a320 (patch)
treec00098d8d4f79cf7ddb131700e9cd6acaebf67d3 /source3/lib
parentdb1ff9b348a16d769f007362fa57ab89f56d101c (diff)
downloadsamba-cc72b666ed93556a2413055f161e67437024a320.tar.gz
samba-cc72b666ed93556a2413055f161e67437024a320.tar.bz2
samba-cc72b666ed93556a2413055f161e67437024a320.zip
r1834: prevent infinite recusion in reopen_logs() when expanding the smb.conf variable %I
(This used to be commit 08037bd4427a99150c1cc65770681ec3f92f4ad5)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/debug.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index e5e203e076..01aedb4774 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -572,6 +572,7 @@ BOOL reopen_logs( void )
oldumask = umask( 022 );
pstrcpy(fname, debugf );
+ debugf[0] = '\0';
if (lp_loaded()) {
char *logfname;
@@ -726,7 +727,12 @@ void check_log_size( void )
errno = old_errno;
return( 0 );
}
-
+
+ /* prevent recursion by checking if reopen_logs() has temporaily
+ set the debugf string to "" */
+ if( debugf[0] == '\0')
+ return( 0 );
+
#ifdef WITH_SYSLOG
if( !lp_syslog_only() )
#endif