diff --git a/srcpkgs/opensmtpd/patches/libressl-compat.patch b/srcpkgs/opensmtpd/patches/libressl-compat.patch new file mode 100644 index 00000000000..b201e4f6115 --- /dev/null +++ b/srcpkgs/opensmtpd/patches/libressl-compat.patch @@ -0,0 +1,97 @@ +From f948b923873a93472dea9b786cf60a3472b0ddc8 Mon Sep 17 00:00:00 2001 +From: Samuel Holland +Date: Wed, 11 Jan 2017 17:35:29 -0600 +Subject: [PATCH] fix compatibility with libressl + +These functions are exported by libcrypto from libressl, due to its +similar OpenBSD compatibility layer, but they are not present in any +header files. Thus, while we can use the existing compiled function, +and do not need to provide our own, we do need to provide the prototype +for it. + +This avoids implicit function declarations and the resulting crashes due +to pointer truncation. + +The patch is based on an equivalent patch for OpenSSH from +https://bugzilla.mindrot.org/show_bug.cgi?id=2465 +Also see +https://github.com/libressl-portable/portable/issues/109 + +Fixes #691 +--- + openbsd-compat/defines.h | 9 --------- + openbsd-compat/openbsd-compat.h | 25 +++++++++++++++---------- + 2 files changed, 15 insertions(+), 19 deletions(-) + +--- openbsd-compat/defines.h ++++ openbsd-compat/defines.h +@@ -422,15 +422,6 @@ typedef uint16_t in_port_t; + #define INET6_ADDRSTRLEN 46 + #endif + +-/* +- * Platforms that have arc4random_uniform() and not arc4random_stir() +- * shouldn't need the latter. +- */ +-#if defined(HAVE_ARC4RANDOM) && defined(HAVE_ARC4RANDOM_UNIFORM) && \ +- !defined(HAVE_ARC4RANDOM_STIR) +-# define arc4random_stir() +-#endif +- + #ifndef HAVE_VA_COPY + # ifdef HAVE___VA_COPY + # define va_copy(dest, src) __va_copy(dest, src) +--- openbsd-compat/openbsd-compat.h ++++ openbsd-compat/openbsd-compat.h +@@ -119,20 +119,25 @@ int BSDoptind; /* index into parent argv vector */ + int getpeereid(int , uid_t *, gid_t *); + #endif + +-#ifdef HAVE_ARC4RANDOM +-# ifndef HAVE_ARC4RANDOM_STIR +-# define arc4random_stir() +-# endif +-#else ++#if !defined(HAVE_ARC4RANDOM) || defined(LIBRESSL_VERSION_NUMBER) + unsigned int arc4random(void); ++#endif ++ ++#if defined(HAVE_ARC4RANDOM_STIR) + void arc4random_stir(void); +-#endif /* !HAVE_ARC4RANDOM */ ++#elif defined(HAVE_ARC4RANDOM) || defined(LIBRESSL_VERSION_NUMBER) ++/* Recent system/libressl implementation; no need for explicit stir */ ++# define arc4random_stir() ++#else ++/* openbsd-compat/arc4random.c provides arc4random_stir() */ ++void arc4random_stir(void); ++#endif + +-#ifndef HAVE_ARC4RANDOM_BUF ++#if !defined(HAVE_ARC4RANDOM_BUF) || defined(LIBRESSL_VERSION_NUMBER) + void arc4random_buf(void *, size_t); + #endif + +-#ifndef HAVE_ARC4RANDOM_UNIFORM ++#if !defined(HAVE_ARC4RANDOM_UNIFORM) || defined(LIBRESSL_VERSION_NUMBER) + uint32_t arc4random_uniform(uint32_t); + #endif + +@@ -174,7 +179,7 @@ int vasprintf(char **, const char *, va_list); + int vsnprintf(char *, size_t, const char *, va_list); + #endif + +-#ifndef HAVE_EXPLICIT_BZERO ++#if !defined(HAVE_EXPLICIT_BZERO) || defined(LIBRESSL_VERSION_NUMBER) + void explicit_bzero(void *p, size_t n); + #endif + +@@ -200,7 +205,7 @@ int pidfile(const char *basename); + struct passwd *pw_dup(const struct passwd *); + #endif + +-#ifndef HAVE_REALLOCARRAY ++#if !defined(HAVE_REALLOCARRAY) || defined(LIBRESSL_VERSION_NUMBER) + void *reallocarray(void *, size_t, size_t); + #endif + diff --git a/srcpkgs/opensmtpd/template b/srcpkgs/opensmtpd/template index dcc6ce71fbb..49080b6e63a 100644 --- a/srcpkgs/opensmtpd/template +++ b/srcpkgs/opensmtpd/template @@ -1,15 +1,11 @@ # Template file for 'opensmtpd' pkgname=opensmtpd version=6.0.2p1 -revision=4 +revision=5 build_style=gnu-configure configure_args="--sysconfdir=/etc/smtpd --sbindir=/usr/bin --with-path-socket=/run --with-mantype=doc --with-pie --with-table-db --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt - ac_cv_search_arc4random=no - ac_cv_func_arc4random=no - ac_cv_func_arc4random_buf=no - ac_cv_func_arc4random_uniform=no ac_cv_func_explicit_bzero=no ac_cv_func_reallocarray=no ac_cv_func_strlcat=no