summaryrefslogtreecommitdiff
path: root/source3/lib/debug.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-02-15 19:36:47 +0000
committerJeremy Allison <jra@samba.org>2000-02-15 19:36:47 +0000
commit3cf31a194f5721b67b1255e3f168d4bc87d433fc (patch)
treef9e3ef842e2bad4d7fb0142f685962e125176b23 /source3/lib/debug.c
parent8688933c7feb87179c178a30e4fc42970fe1da8f (diff)
downloadsamba-3cf31a194f5721b67b1255e3f168d4bc87d433fc.tar.gz
samba-3cf31a194f5721b67b1255e3f168d4bc87d433fc.tar.bz2
samba-3cf31a194f5721b67b1255e3f168d4bc87d433fc.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. (This used to be commit b52e92b09d4ca3b66e534f520468dee27065d048)
Diffstat (limited to 'source3/lib/debug.c')
-rw-r--r--source3/lib/debug.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index a0dfe61f7d..c88f4e1a41 100644
--- a/source3/lib/debug.c
+++ b/source3/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 */
/* ************************************************************************** **