From 01523bbb48e0236385dfab00d138645904255284 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 1 Apr 2015 12:29:26 +0200 Subject: [PATCH] opensmtpd: fix realpath() on glibc with FORTIFY_SOURCE. PATH_MAX must be at least 4096, otherwise glibc will abort because it thinks there's a buffer overflow if it's compiled with _FORTIFY_SOURCE. --- .../glibc-fortify-source-path-max.patch | 18 ++++++++++++++++++ srcpkgs/opensmtpd/template | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/opensmtpd/patches/glibc-fortify-source-path-max.patch diff --git a/srcpkgs/opensmtpd/patches/glibc-fortify-source-path-max.patch b/srcpkgs/opensmtpd/patches/glibc-fortify-source-path-max.patch new file mode 100644 index 00000000000..8295476db60 --- /dev/null +++ b/srcpkgs/opensmtpd/patches/glibc-fortify-source-path-max.patch @@ -0,0 +1,18 @@ +Don't override PATH_MAX, glibc with FORTIFY_SOURCE exactly wants +it as 4096 bytes at least, otherwise it will abort(). + + -- xtraeme + +--- openbsd-compat/defines.h.orig 2015-04-01 12:25:34.304411927 +0200 ++++ openbsd-compat/defines.h 2015-04-01 12:26:10.832810710 +0200 +@@ -65,10 +65,6 @@ enum + * Looks like ugly, but MAX_IMSGSIZE equals 16384, + * and if we don't care it will overflow for some struct + */ +-#if PATH_MAX > 1024 +-# undef PATH_MAX +-# define PATH_MAX 1024 +-#endif + + #if MAXPATHLEN > 1024 + # undef MAXPATHLEN diff --git a/srcpkgs/opensmtpd/template b/srcpkgs/opensmtpd/template index 80f42bf41c5..4e4e299b718 100644 --- a/srcpkgs/opensmtpd/template +++ b/srcpkgs/opensmtpd/template @@ -1,7 +1,7 @@ # Template file for 'opensmtpd' pkgname=opensmtpd version=5.4.4p1 -revision=7 +revision=8 build_style=gnu-configure configure_args="--sysconfdir=/etc/smtpd --sbindir=/usr/sbin --with-maildir=/var/spool/mail --with-privsep-path=/var/db