diff --git a/srcpkgs/opensmtpd/patches/sockaddr.patch b/srcpkgs/opensmtpd/patches/sockaddr.patch new file mode 100644 index 0000000000..c5d185c156 --- /dev/null +++ b/srcpkgs/opensmtpd/patches/sockaddr.patch @@ -0,0 +1,24 @@ +Else it smashes the stack when IPv6 is used. + +--- smtpd/mta_session.c ++++ smtpd/mta_session.c +@@ -1811,15 +1811,15 @@ + static void + mta_connected(struct mta_session *s) + { +- struct sockaddr sa_src; +- struct sockaddr sa_dest; ++ struct sockaddr_storage sa_src; ++ struct sockaddr_storage sa_dest; + int sa_len; + + log_info("%016"PRIx64" mta connected", s->id); + +- if (getsockname(io_fileno(s->io), &sa_src, &sa_len) == -1) ++ if (getsockname(io_fileno(s->io), (struct sockaddr *)(void *)&sa_src, &sa_len) == -1) + bzero(&sa_src, sizeof sa_src); +- if (getpeername(io_fileno(s->io), &sa_dest, &sa_len) == -1) ++ if (getpeername(io_fileno(s->io), (struct sockaddr *)(void *)&sa_dest, &sa_len) == -1) + bzero(&sa_dest, sizeof sa_dest); + + mta_report_link_connect(s, diff --git a/srcpkgs/opensmtpd/template b/srcpkgs/opensmtpd/template index 0aa9fc46bd..fb7f4839df 100644 --- a/srcpkgs/opensmtpd/template +++ b/srcpkgs/opensmtpd/template @@ -1,7 +1,7 @@ # Template file for 'opensmtpd' pkgname=opensmtpd version=6.7.0p1 -revision=1 +revision=2 build_style=gnu-configure configure_args="--sysconfdir=/etc/smtpd --sbindir=/usr/bin --with-path-socket=/run --with-path-pidfile=/run