diff options
author | Jeremy Allison <jra@samba.org> | 2000-02-15 19:36:47 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-02-15 19:36:47 +0000 |
commit | b52e92b09d4ca3b66e534f520468dee27065d048 (patch) | |
tree | dddaeb11e700299abbf352077681b78d38430f0b /source/lib/debug.c | |
parent | 3d6d3863751787b08d40268c83221add1487a5c9 (diff) | |
download | samba-b52e92b09d4ca3b66e534f520468dee27065d048.tar.gz samba-b52e92b09d4ca3b66e534f520468dee27065d048.tar.xz samba-b52e92b09d4ca3b66e534f520468dee27065d048.zip |
Added replacement functions sys_popen and sys_pclose. These are based
on the glibc source code and are safer than the traditional popen as
they don't use a shell to exec the requested command. Now we have
these functions they can be tightened up (environment etc.) as required
to make a safe popen. It should now be safe to add the environement
variable loading code to loadparm.c
Jeremy.
Diffstat (limited to 'source/lib/debug.c')
-rw-r--r-- | source/lib/debug.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/lib/debug.c b/source/lib/debug.c index a0dfe61f7df..c88f4e1a41f 100644 --- a/source/lib/debug.c +++ b/source/lib/debug.c @@ -318,7 +318,8 @@ va_dcl va_start( ap ); format_str = va_arg( ap, char * ); #endif - (void)vfprintf( dbf, format_str, ap ); + if(dbf) + (void)vfprintf( dbf, format_str, ap ); va_end( ap ); errno = old_errno; return( 0 ); @@ -397,9 +398,11 @@ va_dcl va_start( ap ); format_str = va_arg( ap, char * ); #endif - (void)vfprintf( dbf, format_str, ap ); + if(dbf) + (void)vfprintf( dbf, format_str, ap ); va_end( ap ); - (void)fflush( dbf ); + if(dbf) + (void)fflush( dbf ); } errno = old_errno; @@ -488,7 +491,8 @@ static void format_debug_text( char *msg ) void dbgflush( void ) { bufr_print(); - (void)fflush( dbf ); + if(dbf) + (void)fflush( dbf ); } /* dbgflush */ /* ************************************************************************** ** |