Update to 4.16.0

remove a couple of patches committed upstream
add 2 patches (committed upstream) to fix a use-after-free and to let
mkdhparams(8) work with LibreSSL
ok jca@ on a similar diff
This commit is contained in:
giovanni 2015-04-28 07:20:02 +00:00
parent 2077e4f8cc
commit 8d7d59ca1f
12 changed files with 90 additions and 129 deletions

View File

@ -1,14 +1,13 @@
# $OpenBSD: Makefile,v 1.95 2014/08/27 06:58:00 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.96 2015/04/28 07:20:02 giovanni Exp $
COMMENT-main= imap server for maildir format mailboxes
COMMENT-pop3= pop3 server for maildir format mailboxes
V= 4.15
V= 4.16.0
DISTNAME= courier-imap-${V}
PKGNAME-main= ${DISTNAME}
FULLPKGNAME-pop3= courier-pop3-${V}
FULLPKGPATH-pop3= mail/courier-imap,-pop3
REVISION-main= 0
CATEGORIES= mail
@ -89,12 +88,12 @@ CONFIGURE_ARGS+= --disable-workarounds-for-imap-client-bugs
MULTI_PACKAGES= -main -pop3
BUILD_DEPENDS= devel/pcre
LIB_DEPENDS-main= ${LIB_DEPENDS} \
mail/courier-unicode \
databases/gdbm
RUN_DEPENDS-pop3= mail/courier-imap,-main
WANTLIB-main= ${WANTLIB} ssl crypto
WANTLIB-main= ${WANTLIB} ssl crypto unicode
MODULES= devel/gettext
@ -118,8 +117,6 @@ post-extract:
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/courier
${INSTALL_DATA} ${WRKSRC}/libs/unicode/README \
${PREFIX}/share/doc/courier/README.unicode.txt
${INSTALL_DATA} ${WRKSRC}/libs/imap/README \
${PREFIX}/share/doc/courier/README.imap.txt
. for i in ${DOCS}

View File

@ -1,2 +1,2 @@
SHA256 (courier-imap-4.15.tar.bz2) = bDQQfnup5TltULWPtBSklYBjNcq3E1yWrYWjgWeFsQk=
SIZE (courier-imap-4.15.tar.bz2) = 3266353
SHA256 (courier-imap-4.16.0.tar.bz2) = IO5j+7Xu9nHfzO7PPtPrSGY8/zvLYH7MkE0LxPjAtLI=
SIZE (courier-imap-4.16.0.tar.bz2) = 3021228

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-libs_bdbobj_Makefile_in,v 1.1 2014/06/05 20:45:35 giovanni Exp $
--- libs/bdbobj/Makefile.in.orig Sun Aug 25 20:52:35 2013
+++ libs/bdbobj/Makefile.in Fri Oct 4 15:11:24 2013
@@ -123,7 +123,7 @@ am__objects_2 = testbdb.$(OBJEXT)
$OpenBSD: patch-libs_bdbobj_Makefile_in,v 1.2 2015/04/28 07:20:02 giovanni Exp $
--- libs/bdbobj/Makefile.in.orig Sat Dec 13 15:20:58 2014
+++ libs/bdbobj/Makefile.in Sat Apr 4 23:23:25 2015
@@ -124,7 +124,7 @@ am__objects_2 = testbdb.$(OBJEXT)
testbdb_OBJECTS = $(am_testbdb_OBJECTS)
testbdb_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-libs_imap_imapd-ssl_dist_in,v 1.1 2014/06/05 20:45:35 giovanni Exp $
--- libs/imap/imapd-ssl.dist.in.orig Mon Nov 11 03:56:33 2013
+++ libs/imap/imapd-ssl.dist.in Sun Jun 1 17:41:04 2014
$OpenBSD: patch-libs_imap_imapd-ssl_dist_in,v 1.2 2015/04/28 07:20:02 giovanni Exp $
--- libs/imap/imapd-ssl.dist.in.orig Wed Oct 22 10:00:12 2014
+++ libs/imap/imapd-ssl.dist.in Sat Apr 4 23:23:25 2015
@@ -72,13 +72,13 @@ SSLLOGGEROPTS="-name=imapd-ssl"
#
# Whether or not to start IMAP over SSL on simap port:
@ -17,7 +17,7 @@ $OpenBSD: patch-libs_imap_imapd-ssl_dist_in,v 1.1 2014/06/05 20:45:35 giovanni E
##NAME: IMAP_TLS_REQUIRED:1
#
@@ -293,8 +293,8 @@ TLS_VERIFYPEER=NONE
@@ -312,8 +312,8 @@ TLS_VERIFYPEER=NONE
# problems with SSL clients. Disable SSL caching by commenting out the
# following settings:

View File

@ -0,0 +1,34 @@
$OpenBSD: patch-libs_imap_mkdhparams_in,v 1.1 2015/04/28 07:20:02 giovanni Exp $
--- libs/imap/mkdhparams.in.orig Sat Oct 11 17:50:22 2014
+++ libs/imap/mkdhparams.in Sun Apr 26 01:12:12 2015
@@ -7,6 +7,12 @@
# Override from the environment
+@OPENSSL@ version | grep LibreSSL 1>/dev/null
+if test $? = 0
+then
+ LIBRESSL=1
+fi
+
if test "$TLS_DHPARAMS" = ""
then
TLS_DHPARAMS="@certsdir@/dhparams.pem"
@@ -36,9 +42,14 @@ then
BITS=2048
fi
- dd if=@RANDOMV@ of=$TLS_DHPARAMS.rand.tmp count=1 2>/dev/null
- @OPENSSL@ dhparam -rand $TLS_DHPARAMS.rand.tmp -outform PEM $BITS >$TLS_DHPARAMS.tmp
- rm -f $TLS_DHPARAMS.rand.tmp
+ if test "$LIBRESSL" = 0
+ then
+ dd if=@RANDOMV@ of=$TLS_DHPARAMS.rand.tmp count=1 2>/dev/null
+ @OPENSSL@ dhparam -rand $TLS_DHPARAMS.rand.tmp -outform PEM $BITS >$TLS_DHPARAMS.tmp
+ rm -f $TLS_DHPARAMS.rand.tmp
+ else
+ @OPENSSL@ dhparam -outform PEM $BITS >$TLS_DHPARAMS.tmp
+ fi
mv -f $TLS_DHPARAMS.tmp $TLS_DHPARAMS
else
if test "$BITS" = ""

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-libs_imap_pop3d-ssl_dist_in,v 1.1 2014/06/05 20:45:35 giovanni Exp $
--- libs/imap/pop3d-ssl.dist.in.orig Mon Nov 11 03:56:33 2013
+++ libs/imap/pop3d-ssl.dist.in Sun Jun 1 17:41:04 2014
@@ -256,8 +256,8 @@ TLS_VERIFYPEER=NONE
$OpenBSD: patch-libs_imap_pop3d-ssl_dist_in,v 1.2 2015/04/28 07:20:02 giovanni Exp $
--- libs/imap/pop3d-ssl.dist.in.orig Wed Oct 22 10:00:12 2014
+++ libs/imap/pop3d-ssl.dist.in Sat Apr 4 23:23:25 2015
@@ -277,8 +277,8 @@ TLS_VERIFYPEER=NONE
# problems with SSL clients. Disable SSL caching by commenting out the
# following settings:

View File

@ -1,82 +0,0 @@
$OpenBSD: patch-libs_liblock_locktest_c,v 1.1 2014/06/05 20:45:35 giovanni Exp $
--- libs/liblock/locktest.c.orig Sun Aug 25 20:52:10 2013
+++ libs/liblock/locktest.c Fri Oct 4 15:13:39 2013
@@ -5,6 +5,7 @@
/* $Id */
+#include <paths.h>
#include "liblock.h"
#if USE_FCNTL
#include "lockfcntl.c"
@@ -20,11 +21,23 @@
int main()
{
+#define FILENAME "courier-imap.locktest.XXXXXXXXXX"
int fd[2];
pid_t p;
int s;
int f;
+ char *name;
+ const char *tmpdir;
+ if ((tmpdir = (char *)getenv("TMPDIR")) == NULL)
+ tmpdir = _PATH_TMP;
+ (void)asprintf(&name, "%s%s%s", tmpdir,
+ (tmpdir[strlen(tmpdir) - 1] == '/') ? "" : "/", FILENAME);
+ if (name == NULL) {
+ perror("get filename");
+ exit(1);
+ }
+
signal(SIGCHLD, SIG_DFL);
if (pipe(fd))
{
@@ -32,6 +45,12 @@ int f;
return (1);
}
+ if ((f=mkstemp(name)) < 0)
+ {
+ perror("open");
+ exit(1);
+ }
+
if ((p=fork()) == (pid_t)-1)
{
perror("fork");
@@ -46,7 +65,7 @@ int f;
read(fd[0], &c, 1);
close(fd[0]);
- if ((f=open("conftest.lock", O_RDWR|O_CREAT, 0644)) < 0)
+ if ((f=open(name, O_RDWR)) < 0)
{
perror("open");
exit(1);
@@ -56,22 +75,18 @@ int f;
if (ll_lockfd(f, ll_writelock, 0, 0))
{
close(f);
+ unlink(name);
exit(0);
}
close(f);
exit(1);
}
-
- if ((f=open("conftest.lock", O_RDWR|O_CREAT, 0644)) < 0)
- {
- perror("open");
- exit(1);
- }
if (ll_lockfd(f, ll_writelock, 0, 0))
{
perror("lock");
close(f);
+ unlink(name);
exit(1);
}
close(fd[1]);

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-libs_maildir_Makefile_in,v 1.1 2014/06/05 20:45:35 giovanni Exp $
--- libs/maildir/Makefile.in.orig Sun Jun 1 18:22:24 2014
+++ libs/maildir/Makefile.in Sun Jun 1 18:24:01 2014
@@ -574,7 +574,7 @@ clean-noinstLTLIBRARIES:
$OpenBSD: patch-libs_maildir_Makefile_in,v 1.2 2015/04/28 07:20:02 giovanni Exp $
--- libs/maildir/Makefile.in.orig Sat Dec 13 15:21:33 2014
+++ libs/maildir/Makefile.in Sat Apr 4 23:23:25 2015
@@ -575,7 +575,7 @@ clean-noinstLTLIBRARIES:
}
libmaildir.la: $(libmaildir_la_OBJECTS) $(libmaildir_la_DEPENDENCIES) $(EXTRA_libmaildir_la_DEPENDENCIES)

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-libs_maildir_configure,v 1.1 2014/06/05 20:45:35 giovanni Exp $
--- libs/maildir/configure.orig Sun Aug 25 20:53:34 2013
+++ libs/maildir/configure Sun Jun 1 18:11:15 2014
@@ -16396,7 +16396,7 @@ $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
$OpenBSD: patch-libs_maildir_configure,v 1.2 2015/04/28 07:20:02 giovanni Exp $
--- libs/maildir/configure.orig Sat Dec 13 15:21:34 2014
+++ libs/maildir/configure Sat Apr 4 23:23:26 2015
@@ -16561,7 +16561,7 @@ $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
fi
@ -10,7 +10,7 @@ $OpenBSD: patch-libs_maildir_configure,v 1.1 2014/06/05 20:45:35 giovanni Exp $
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -16416,16 +16416,6 @@ if test "x$ac_cv_header_pcre_h" = xyes; then :
@@ -16581,16 +16581,6 @@ if test "x$ac_cv_header_pcre_h" = xyes; then :
fi
@ -27,7 +27,7 @@ $OpenBSD: patch-libs_maildir_configure,v 1.1 2014/06/05 20:45:35 giovanni Exp $
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
if ${ac_cv_header_sys_wait_h+:} false; then :
@@ -16890,7 +16880,7 @@ if ${ac_cv_lib_fam_FAMOpen+:} false; then :
@@ -17055,7 +17045,7 @@ if ${ac_cv_lib_fam_FAMOpen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@ -36,7 +36,7 @@ $OpenBSD: patch-libs_maildir_configure,v 1.1 2014/06/05 20:45:35 giovanni Exp $
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -16925,7 +16915,7 @@ if test "x$ac_cv_lib_fam_FAMOpen" = xyes; then :
@@ -17090,7 +17080,7 @@ if test "x$ac_cv_lib_fam_FAMOpen" = xyes; then :
LIBFAM=-lfam
cat >>confdefs.h <<_ACEOF
@ -45,7 +45,7 @@ $OpenBSD: patch-libs_maildir_configure,v 1.1 2014/06/05 20:45:35 giovanni Exp $
_ACEOF
@@ -16955,7 +16945,6 @@ fi
@@ -17120,7 +17110,6 @@ fi

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-libs_maildir_maildircache_c,v 1.1 2015/04/28 07:20:02 giovanni Exp $
fix a use-after-free
--- libs/maildir/maildircache.c.orig Thu Apr 23 23:58:45 2015
+++ libs/maildir/maildircache.c Fri Apr 24 00:00:09 2015
@@ -249,17 +249,18 @@ FILE *fp;
exit(1);
}
}
- free(f);
if ( fwrite(data, strlen(data), 1, fp) != 1 || fflush(fp)
|| ferror(fp))
{
fclose(fp);
unlink(f); /* Problems */
+ free(f);
fprintf(stderr, "CRIT: maildircache: Cache create failure - write error.\n");
exit(1);
}
else fclose(fp);
+ free(f);
exit(0);
}

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-libs_tcpd_libcouriertls_c,v 1.1 2014/06/05 20:45:35 giovanni Exp $
--- libs/tcpd/libcouriertls.c.orig Mon Nov 11 03:56:33 2013
+++ libs/tcpd/libcouriertls.c Sun Jun 1 17:41:05 2014
@@ -806,7 +806,7 @@ static int get_func(void *rec, size_t recsize,
time_t timeout;
size_t session_id_len;
- unsigned char *sess;
+ const unsigned char *sess;
if (recsize < sizeof(timeout)+sizeof(session_id_len))
return (0);

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST-main,v 1.10 2014/06/05 20:45:35 giovanni Exp $
@comment $OpenBSD: PLIST-main,v 1.11 2015/04/28 07:20:02 giovanni Exp $
@conflict imap-uw-*
@conflict courier-utils-*
@pkgpath ${BASE_PKGPATH}
@ -42,7 +42,6 @@ share/doc/courier/README.maildirfilter.html
share/doc/courier/README.maildirquota.txt
share/doc/courier/README.proxy
share/doc/courier/README.sharedfolders.txt
share/doc/courier/README.unicode.txt
share/examples/courier/
@mode 600
share/examples/courier/imapd-ssl.dist