fixed a nasty bug in debug.c
authorAndrew Tridgell <tridge@samba.org>
Tue, 11 Aug 1998 14:09:05 +0000 (14:09 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 11 Aug 1998 14:09:05 +0000 (14:09 +0000)
Debug1() was being called like this:

      Debug1( format_bufr );

but if format_bufr contains any %s or other % arguments (such as when
processing a smb.conf file containing % macros) then smbd dies a
horrible death.

The quick fix is to use:

Debug1( "%s", format_bufr);
(This used to be commit 5ae04012819ae3e63102d6875088ef00c27492b4)

source3/lib/debug.c

index 02bf6710f5531a4c1e492fab05eb741e8358ed2b..8f7887006f3955d33c98d3aa9d3656f78f2f7d8d 100644 (file)
@@ -422,7 +422,7 @@ static void format_debug_text( char *msg )
     if( '\n' == msg[i] )
       {
       format_bufr[format_pos] = '\0';
     if( '\n' == msg[i] )
       {
       format_bufr[format_pos] = '\0';
-      Debug1( format_bufr );
+      Debug1( "%s", format_bufr );
       format_pos = 0;
       }
     }
       format_pos = 0;
       }
     }