Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
merge 3.1 latest into Cyrus-OpenIO
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondPo committed Aug 26, 2015
2 parents 64f0ede + b101e43 commit 09c5cba
Show file tree
Hide file tree
Showing 75 changed files with 6,735 additions and 3,448 deletions.
72 changes: 21 additions & 51 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ cunit_TESTS = \
cunit/guid.testc \
cunit/hash.testc \
cunit/imapurl.testc \
cunit/lock_file.testc \
cunit/mboxname.testc \
cunit/md5.testc \
cunit/message.testc \
Expand Down Expand Up @@ -681,12 +682,12 @@ cunit_unit_LDADD += $(LD_UTILITY_ADD) -lcunit
CUNIT_PL = $(top_srcdir)/cunit/cunit.pl --project $(CUNIT_PROJECT)

.testc.o:
$(CUNIT_PL) --generate-wrapper $<
$(COMPILE) -c -o $@ $<-cunit.c
$(RM) $<-cunit.c
$(AM_V_at)$(CUNIT_PL) --generate-wrapper $<
$(AM_V_CC)$(COMPILE) -c -o $@ $<-cunit.c
$(AM_V_at)$(RM) $<-cunit.c

$(CUNIT_PROJECT):
@$(RM) $@
$(AM_V_at)$(RM) $@
$(AM_V_GEN)$(CUNIT_PL) --add-sources $(addprefix $(top_srcdir)/,$(cunit_TESTS))

cunit/registers.h: $(CUNIT_PROJECT)
Expand Down Expand Up @@ -751,6 +752,7 @@ include_HEADERS = \
lib/iostat.h \
lib/iptostring.h \
lib/libcyr_cfg.h \
lib/lock_file.h \
lib/lsort.h \
lib/map.h \
lib/mappedfile.h \
Expand Down Expand Up @@ -849,7 +851,7 @@ EXTRA_DIST += \
endif # HAVE_CLAMAV

if HTTPD
imap_ctl_zoneinfo_SOURCES = imap/cli_fatal.c imap/ctl_zoneinfo.c imap/mutex_fake.c
imap_ctl_zoneinfo_SOURCES = imap/cli_fatal.c imap/ctl_zoneinfo.c imap/mutex_fake.c imap/zoneinfo_db.c
imap_ctl_zoneinfo_LDADD = $(LD_UTILITY_ADD)
else # HTTPD
EXTRA_DIST += \
Expand Down Expand Up @@ -1064,47 +1066,10 @@ imap_libcyrus_imap_la_SOURCES += \
imap/dav_db.h \
imap/dav_util.c \
imap/dav_util.h \
imap/http_caldav.c \
imap/http_caldav_sched.c \
imap/http_caldav_sched.h \
imap/http_carddav.c \
imap/http_client.c \
imap/http_client.h \
imap/http_dav.c \
imap/http_dav.h \
imap/http_dblookup.c \
imap/http_ischedule.c \
imap/http_jmap.c \
imap/http_proxy.c \
imap/http_proxy.h \
imap/http_rss.c \
imap/http_tzdist.c \
imap/http_webdav.c \
imap/httpd.c \
imap/httpd.h \
imap/ical_support.c \
imap/ical_support.h \
imap/jcal.c \
imap/jcal.h \
imap/proxy.c \
imap/proxy.h \
imap/smtpclient.c \
imap/smtpclient.h \
imap/spool.c \
imap/spool.h \
imap/webdav_db.c \
imap/webdav_db.h \
imap/xcal.c \
imap/xcal.h \
imap/xml_support.c \
imap/xml_support.h \
imap/zoneinfo_db.c \
imap/zoneinfo_db.h

nodist_imap_libcyrus_imap_la_SOURCES += \
imap/http_caldav_js.h \
imap/http_err.c \
imap/tz_err.c
imap/webdav_db.h

endif # HTTPD

Expand Down Expand Up @@ -1149,7 +1114,7 @@ SNMPGEN = $(abs_top_srcdir)/snmp/snmpgen
imap/lmtpstats.c: imap/lmtpstats.snmp $(SNMPGEN)
$(AM_V_GEN)(cd $(@D) && $(SNMPGEN) $(realpath $<))

imap/pushstats.c: imap/pushstats.snmp snmp/snmpgen
imap/pushstats.c: imap/pushstats.snmp $(SNMPGEN)
$(AM_V_GEN)(cd $(@D) && $(SNMPGEN) $(realpath $<))

imap_mbexamine_SOURCES = imap/cli_fatal.c imap/mbexamine.c imap/mutex_fake.c
Expand Down Expand Up @@ -1195,36 +1160,40 @@ nodist_imap_httpd_SOURCES = \
imap/tz_err.h

imap_httpd_SOURCES = \
imap/caldav_alarm.c \
imap/caldav_db.c \
imap/carddav_db.c \
imap/carddav_db.h \
imap/dav_db.c \
imap/dav_util.c \
imap/http_admin.c \
imap/http_caldav.c \
imap/http_caldav_sched.c \
imap/http_caldav_sched.h \
imap/http_carddav.c \
imap/http_client.c \
imap/http_client.h \
imap/http_dav.c \
imap/http_dav.h \
imap/http_dblookup.c \
imap/http_ischedule.c \
imap/http_jmap.c \
imap/http_jmap.h \
imap/http_proxy.c \
imap/http_proxy.h \
imap/http_rss.c \
imap/http_tzdist.c \
imap/http_webdav.c \
imap/httpd.c \
imap/httpd.h \
imap/ical_support.c \
imap/jcal.c \
imap/jcal.h \
imap/mutex_fake.c \
imap/proxy.c \
imap/smtpclient.c \
imap/spool.c \
imap/webdav_db.c \
imap/xcal.c \
imap/xcal.h \
imap/xml_support.c \
imap/xml_support.h \
imap/zoneinfo_db.c \
imap/zoneinfo_db.h \
master/masterconf.c \
master/service.c

imap_httpd_LDADD = $(LD_SERVER_ADD)
Expand Down Expand Up @@ -1403,6 +1372,7 @@ lib_libcyrus_min_la_SOURCES = \
lib/hashu64.c \
lib/imapopts.c \
lib/libconfig.c \
lib/lock_file.c \
lib/mpool.c \
lib/retry.c \
lib/strarray.c \
Expand Down
1 change: 0 additions & 1 deletion SMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ esac

# settings; we have to disable these on some platforms
DEBUG=""
WITHAUTH="--with-auth=pts --with-afs=/usr/local --enable-krb5afspts --without-krbdes"
SSL_CONFIG="--with-openssl=/usr/local/lib"

# the defaults are good enough for us
Expand Down
28 changes: 21 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dnl configure.ac for the Cyrus imapd
dnl


AC_INIT([cyrus-imapd], [3.0], [http://bugzilla.cyrusimap.org],,[http://www.cyrusimap.org])
AC_INIT([cyrus-imapd], [3.0.0-beta1], [http://bugzilla.cyrusimap.org],,[http://www.cyrusimap.org])
AC_PREREQ([2.63])
AC_CONFIG_SRCDIR([imap/imapd.c])
AC_CONFIG_HEADERS(config.h)
Expand Down Expand Up @@ -928,7 +928,7 @@ AM_CONDITIONAL([PTCLIENT], [test "x$enable_afs" = "xyes" -o "$have_ldap" = "yes"

AC_ARG_WITH(
clamav,
[ --with-clamav=DIR use ClamAV from PATH (yes)],
[AS_HELP_STRING([--with-clamav=DIR], [use ClamAV from PATH (no)])],
with_clamav=$withval,
with_clamav=no
)
Expand Down Expand Up @@ -1009,7 +1009,7 @@ if test "$with_krbdes" = "yes"; then
else
KRB_LIBS="-ldes"
fi,
AC_MSG_ERROR([The Kerberos DES library is required for Kerberos support. You might want --with-auth=unix.]))
AC_MSG_ERROR([The Kerberos DES library is required for Kerberos support.]))
fi
fi

Expand Down Expand Up @@ -1275,6 +1275,16 @@ if test "$enable_event_notification" != "no"; then
[check_jansson=false]
[AC_MSG_WARN([jansson 2.0 or later was not found, but is required to enable mailbox event notification])]
enable_event_notification="no")

dnl support for Apple Push Service registration
dnl disabled by default
AC_ARG_ENABLE(apple-push-service,
[AS_HELP_STRING([--enable-apple-push-service], [enable support for Apple Push Service (requires event notifications])],,
[enable_apple_push_service="no";])

if test "$enable_apple_push_service" != "no"; then
AC_DEFINE(ENABLE_APPLEPUSHSERVICE,[],[Build with support for Apple Push Service])
fi
fi
AM_CONDITIONAL(JANSSON, test x$check_jansson = xtrue)

Expand Down Expand Up @@ -1341,7 +1351,8 @@ if test "$enable_http" != no; then
dnl
dnl make sure all the modules we need are present
dnl
PKG_CHECK_MODULES([XML2], [libxml-2.0],,
PKG_CHECK_MODULES([XML2], [libxml-2.0],
LIBS="$LIBS ${XML2_LIBS}",
AC_MSG_ERROR([Need libxml-2.0 for http]))

AC_CHECK_LIB(xml2, xmlFirstElementChild, [
Expand All @@ -1357,8 +1368,10 @@ dnl
AC_DEFINE(WITH_DAV,[],[Build *DAV support into httpd?]),
AC_MSG_ERROR([Need sqlite3 for http]))

PKG_CHECK_MODULES([ICAL], [libical],
AC_DEFINE(HAVE_ICAL,[],[Build CalDAV support into httpd?]),
PKG_CHECK_MODULES([ICAL], [libical], [
AC_DEFINE(HAVE_ICAL,[],[Build CalDAV support into httpd?])
LIBS="$LIBS ${ICAL_LIBS}"
],
AC_MSG_ERROR([Need libical for http]))

AC_CHECK_LIB(ical, icalparameter_new_iana, [
Expand Down Expand Up @@ -1399,7 +1412,7 @@ dnl

PKG_CHECK_MODULES([JANSSON], [jansson],
AC_DEFINE(WITH_JSON,[],
[Build jCal/jCard/TZdist support into httpd?]),
[Build jCal/jCard/JMAP/TZdist support into httpd?]),
AC_MSG_ERROR([Need jansson for http]))

PKG_CHECK_MODULES([DKIM], [opendkim >= 2.7.0],
Expand Down Expand Up @@ -1927,6 +1940,7 @@ echo "
Cyrus Server configured components

event notification: $enable_event_notification
apple push service: $enable_apple_push_service
gssapi: $gssapi
autocreate: $enable_autocreate
idled: $enable_idled
Expand Down
Binary file added contrib/xapian_quilt.tar
Binary file not shown.
26 changes: 26 additions & 0 deletions cunit/charset.testc
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,32 @@ static void test_qp(void)
#undef TESTCASE
}

static void test_encode_mimeheader(void)
{
/* corner cases in Quoted-Printable */
#define TESTCASE(in, exp) \
{ \
static const char _in[] = (in); \
static const char _exp[] = (exp); \
char *s = charset_encode_mimeheader(_in, 0); \
CU_ASSERT_PTR_NOT_NULL(s); \
CU_ASSERT_STRING_EQUAL(s, _exp); \
free(s); \
}

TESTCASE("abc", "abc");

TESTCASE("abc\r\n", "=?UTF-8?Q?abc?=");

/* bogus indent */
TESTCASE("abc\r\nxyz", "=?UTF-8?Q?abc?=\r\n =?UTF-8?Q?xyz?=");

/* wrap */
TESTCASE("abc\r\n xyz", "=?UTF-8?Q?abc?=\r\n =?UTF-8?Q?xyz?=");

#undef TESTCASE
}


static void test_decode_mimeheader(void)
{
Expand Down
23 changes: 23 additions & 0 deletions cunit/cunit.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,29 @@ extern int __cunit_wrap_fixture(const char *name, int (*fn)(void));
__FILE__, "", CU_TRUE, \
"CU_ASSERT_SYSLOG_FATAL(/%s/=%u, " #expected "=%u)", _s, _a, _e); }

extern jmp_buf fatal_jbuf;
extern int fatal_expected;
extern const char *fatal_string;
extern int fatal_code;

#define CU_EXPECT_CYRFATAL_BEGIN \
do { \
fatal_expected = 1; \
fatal_string = NULL; \
fatal_code = 0; \
if (!setjmp(fatal_jbuf)) { \
/* code that we expect to call fatal() */

#define CU_EXPECT_CYRFATAL_END(expected_code, expected_string) \
CU_FAIL_FATAL("fatal codepath didn't call fatal"); \
} else { \
int _ec = (expected_code); \
const char *_es = (expected_string); \
CU_ASSERT_EQUAL(fatal_code, _ec); \
if (_es) CU_ASSERT_STRING_EQUAL(fatal_string, _es); \
} } while (0)


/* for parametrised tests */

#define CUNIT_PARAM(x) (x)
Expand Down
Loading

0 comments on commit 09c5cba

Please sign in to comment.