gentoo / musl

[MIRROR] musl development overlay
https://gitweb.gentoo.org/proj/musl.git
98 stars 59 forks source link

mail-mta/postfix: does not detect file descriptor passing #53

Closed wylfen closed 7 years ago

wylfen commented 7 years ago

postfix builds without problems, but when used with a milter or its postscreen utility, it fails at runtime with the following error:

warning: unix_send_fd: your system has no support for file descriptor passing
warning: pass_accept_attr: cannot receive file descriptor: No error information
error: accept connection: No error information

sys_defs.h checks for file descriptor support like this, assuming that __GLIBC__ is defined:

 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)) || (__GLIBC__ < 2)

To make this work with musl, the following patch is needed:

--- postfix-3.1.2-r2/src/util/sys_defs.h 2017-06-05 02:46:02.016419848 +0000
+++ src/util/sys_defs.h 2017-06-05 02:46:37.275600185 +0000
@@ -813,7 +813,7 @@
 #define KERNEL_VERSION(a,b,c) (LINUX_VERSION_CODE + 1)
 #endif
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)) \
-   || (__GLIBC__ < 2)
+   || (defined(__GLIBC__) && (__GLIBC__ < 2))
 #define CANT_USE_SEND_RECV_MSG
 #define DEF_SMTP_CACHE_DEMAND  0
 #else

See also this bug for Alpine Linux.

blueness commented 7 years ago

Looks correct to me. Do you want to create a pull request? Also, this should go upstream.

wylfen commented 7 years ago

I'll go ahead and open a pull request. I shall also report this to upstream via the postfix mailing list.

wylfen commented 7 years ago

Now also in upstream, see here.