Smbmount segfaults when it tries to remount volume (samba 2.0.6)

Elvis Pfutzenreuter epx at conectiva.com.br
Wed Feb 2 15:50:08 GMT 2000


Smbmount can remount volumes when connection to server is broken. It
happens when kernel sends SIGUSR1 to smbmount process. But since smbmount
closes all file descriptors and makes dbf = NULL, if lib/debug.c tries to
write some information, vfprintf faces a null dbf an segfaults.

Included (possibily not ideal) patch so lib/debug.c, so it checks if dbf
!= NULL. 

diff -urN samba-2.0.6.old/source/lib/debug.c samba-2.0.6/source/lib/debug.c
--- samba-2.0.6.old/source/lib/debug.c	Thu Nov 11 00:36:01 1999
+++ samba-2.0.6/source/lib/debug.c	Wed Feb  2 13:32:13 2000
@@ -318,7 +318,7 @@
     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,7 +397,7 @@
     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 );
     }



More information about the samba-technical mailing list