Patch proposal

Richard Sharpe sharpe at ns.aus.com
Thu Oct 25 09:18:50 GMT 2001


How, this is great ...

Thanks for the patches. I won't be able to do anything for a day or so, 
as I am flying back to Oz from the US, but perhaps Jeremy or Jerry can 
apply the patchs.

Tom Jansen wrote:

>Hi everyone,
>
>I've been using libsmbclient quite often lately and I must say it works great,
>however I believe I have discovered some errors.
>
>The first one is located in lib/debug.c where a possible NULL pointer is used as
>an argument to a function that doesn't check for NULL.
>
>The second one was a little harder to track down and is located in
>lib/util_sock.c where send() causes a SIGPIPE. SIGPIPE is never caught and I
>think that the default errorhandling in write_socket_data() can handle the error
>nicely.
>
>I've created two patches that fixed the two problems for me. The patches are
>made against the HEAD branch. Both are attached to this message. 
>If this is not the correct way to fix it please let me know so I can create a
>decent fix. Or at least try :-)
>
>yours,
>	Tom
>
>
>------------------------------------------------------------------------
>
>--- lib/util_sock.c.orig	Thu Oct 25 14:20:57 2001
>+++ lib/util_sock.c	Thu Oct 25 14:20:30 2001
>@@ -532,7 +532,7 @@
>       ret = send(fd,buffer + total,N - total, 0);
>     }
> #else /* WITH_SSL */
>-    ret = send(fd,buffer + total,N - total,0);
>+    ret = send(fd,buffer + total,N - total, MSG_NOSIGNAL);
> #endif /* WITH_SSL */
> 
>     if (ret == -1) {
>
>
>------------------------------------------------------------------------
>
>--- lib/debug.c.orig	Thu Oct 25 14:14:42 2001
>+++ lib/debug.c	Fri Oct  5 22:51:18 2001
>@@ -365,10 +365,10 @@
> 		log_overflow = True;
> 		DEBUG(0, ("Unable to open new log file %s: %s\n", debugf, strerror(errno)));
> 		log_overflow = False;
>-		x_fflush(dbf);
>+		if (dbf) x_fflush(dbf);
> 		ret = False;
> 	} else {
>-		x_setbuf(new_dbf, NULL);
>+	        x_setbuf(new_dbf, NULL);
> 		if (dbf)
> 			(void) x_fclose(dbf);
> 		dbf = new_dbf;
>

-- 
Richard Sharpe, rsharpe at ns.aus.com, LPIC-1
www.samba.org, www.ethereal.com, SAMS Teach Yourself Samba 
in 24 Hours, Special Edition, Using Samba







More information about the samba-technical mailing list