Skip Menu |

This queue is for tickets about the File-FDpasser CPAN distribution.

Report information
The Basics
Id: 45197
Status: open
Priority: 0/
Queue: File-FDpasser

People
Owner: Nobody in particular
Requestors: sam [...] email-scan.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.09
Fixed in: (no value)



Subject: Breakage on Linux 64 bit -- fix included
The module is definitely broken on Linux 64 bit. The attached patch fixes it.
Subject: bsd44.patch.txt
--- bsd44.c.orig 1999-07-28 22:13:18.000000000 -0400 +++ bsd44.c 2009-04-21 19:31:36.000000000 -0400 @@ -16,7 +16,7 @@ static struct cmsghdr *cmptr = NULL; /* buffer is malloc'ed first time */ -#define CONTROLLEN (sizeof(struct cmsghdr) + sizeof(int)) +#define CONTROLLEN (CMSG_SPACE(sizeof(int))) /* size of control buffer to send/recv one file descriptor */
An strace found a problem with my original patch. Here's the proper fix.
--- bsd44.c.orig 1999-07-28 22:13:18.000000000 -0400 +++ bsd44.c 2009-04-22 19:57:40.000000000 -0400 @@ -16,7 +16,7 @@ static struct cmsghdr *cmptr = NULL; /* buffer is malloc'ed first time */ -#define CONTROLLEN (sizeof(struct cmsghdr) + sizeof(int)) +#define CONTROLLEN (CMSG_SPACE(sizeof(int))) /* size of control buffer to send/recv one file descriptor */ @@ -44,7 +44,7 @@ if (cmptr == NULL && (cmptr = malloc(CONTROLLEN)) == NULL) return(-1); cmptr->cmsg_level = SOL_SOCKET; cmptr->cmsg_type = SCM_RIGHTS; - cmptr->cmsg_len = CONTROLLEN; + cmptr->cmsg_len = sizeof(struct cmsghdr) + sizeof(int); msg.msg_control = (caddr_t) cmptr; msg.msg_controllen = CONTROLLEN; *(int *)CMSG_DATA(cmptr) = fd; /* the fd to pass */
From: seakoudr [...] guerrillamailblock.com
thanks for this, helped me out a lot. Hopefully it gets added into distrib at some point.
On Wed Apr 22 20:00:45 2009, MRSAM wrote: Show quoted text
> An strace found a problem with my original patch. Here's the proper fix.
Thanks from me also. Martin -- Martin J. Evans Wetherby, UK