Use larger buffer for sending and receiving a file descriptor over a

UNIX domain socket, based on an example program by Michael van Elst.
This fixes support for using milters (Sendmail Mail Filters) with
Postfix under at least NetBSD/amd64.
This commit is contained in:
tron 2009-03-08 21:52:10 +00:00
parent ea6a01a6c4
commit ffbff10ba1
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ int unix_recv_fd(int fd)
memset((char *) &msg, 0, sizeof(msg)); /* Fix 200512 */
msg.msg_control = control_un.control;
msg.msg_controllen = CMSG_LEN(sizeof(newfd)); /* Fix 200506 */
msg.msg_controllen = sizeof(control_un.control); /* Fix 200506 */
#else
msg.msg_accrights = (char *) &newfd;
msg.msg_accrightslen = sizeof(newfd);

View File

@ -76,7 +76,7 @@ int unix_send_fd(int fd, int sendfd)
memset((char *) &msg, 0, sizeof(msg)); /* Fix 200512 */
msg.msg_control = control_un.control;
msg.msg_controllen = CMSG_LEN(sizeof(sendfd)); /* Fix 200506 */
msg.msg_controllen = sizeof(control_un.control); /* Fix 200506 */
cmptr = CMSG_FIRSTHDR(&msg);
cmptr->cmsg_len = CMSG_LEN(sizeof(sendfd));