durusmail: quixote-users: [PATCH] make passfd/scgi work for me
[PATCH] make passfd/scgi work for me
[PATCH] make passfd/scgi work for me
2006-04-13
[PATCH] make passfd/scgi work for me
Jonathan Corbet
2006-04-13
I've spent a little while trying to figure out why passfd stopped
working on my x86-64 system.  As far as I can tell, it comes down to
random junk in the tmpbuf buffer which is only partially overwritten by
the file descriptor assignment.  Zeroing out tmpbuf makes things work
again.

jon

--- scgi-1.10/scgi/passfd.c~    2005-12-06 07:39:26.000000000 -0700
+++ scgi-1.10/scgi/passfd.c     2006-04-13 16:01:21.000000000 -0600
@@ -58,6 +58,7 @@ send_fd (int sockfd, int fd)
         struct msghdr msg;
         void* buf[1];

+        memset(tmpbuf, 0, CONTROLLEN);
         iov[0].iov_base = buf;
         iov[0].iov_len = 1;
         msg.msg_iov = iov;
reply