]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r1834: prevent infinite recusion in reopen_logs() when expanding the smb.conf variable %I
authorGerald Carter <jerry@samba.org>
Mon, 16 Aug 2004 15:30:17 +0000 (15:30 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:21 +0000 (10:52 -0500)
source/lib/debug.c

index e5e203e076a6bb367686e43b3ea4cab9cfd9ae76..01aedb47740ec5fa1987ecb6a31a7fbe6aff5d02 100644 (file)
@@ -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