[PATCH] make passfd/scgi work for me

Jonathan Corbet <[email protected]>
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.