Projects
Kolab:Winterfell
cyrus-imapd
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 7
View file
cyrus-imapd-2.5.8.12.tar.gz/imap/caldav_db.c -> cyrus-imapd-2.5.8.22.tar.gz/imap/caldav_db.c
Changed
@@ -77,7 +77,7 @@ struct caldav_db { sqlite3 *db; /* DB handle */ - char sched_inbox[MAX_MAILBOX_BUFFER];/* DB owner's scheduling Inbox */ + char *sched_inbox; /* DB owner's scheduling Inbox */ sqlite3_stmt *stmt[NUM_STMT]; /* prepared statements */ struct buf mailbox; /* buffers for copies of column text */ struct buf resource; @@ -182,7 +182,7 @@ buf_free(&fname); /* Construct mbox name corresponding to userid's scheduling Inbox */ - strncpy(caldavdb->sched_inbox, caldav_mboxname(userid, SCHED_INBOX), sizeof(caldavdb->sched_inbox)); + caldavdb->sched_inbox = caldav_mboxname(userid, SCHED_INBOX); return caldavdb; } @@ -214,6 +214,7 @@ if (!caldavdb) return 0; + free(caldavdb->sched_inbox); buf_free(&caldavdb->mailbox); buf_free(&caldavdb->resource); buf_free(&caldavdb->lock_token); @@ -909,10 +910,10 @@ } -EXPORTED const char *caldav_mboxname(const char *userid, const char *name) +EXPORTED char *caldav_mboxname(const char *userid, const char *name) { struct buf boxbuf = BUF_INITIALIZER; - const char *res = NULL; + char *res = NULL; buf_setcstr(&boxbuf, config_getstring(IMAPOPT_CALENDARPREFIX));
View file
cyrus-imapd-2.5.8.12.tar.gz/imap/caldav_db.h -> cyrus-imapd-2.5.8.22.tar.gz/imap/caldav_db.h
Changed
@@ -165,6 +165,6 @@ /* create caldav_data from icalcomponent */ void caldav_make_entry(icalcomponent *ical, struct caldav_data *cdata); -const char *caldav_mboxname(const char *userid, const char *name); +char *caldav_mboxname(const char *userid, const char *name); #endif /* CALDAV_DB_H */
View file
cyrus-imapd-2.5.8.12.tar.gz/imap/http_caldav.c -> cyrus-imapd-2.5.8.22.tar.gz/imap/http_caldav.c
Changed
@@ -828,6 +828,7 @@ buf_free(&ical_prodid_buf); freestrlist(cua_domains); + my_caldav_reset(); caldav_done(); }
View file
cyrus-imapd-2.5.8.12.tar.gz/imap/ipurge.c -> cyrus-imapd-2.5.8.22.tar.gz/imap/ipurge.c
Changed
@@ -92,6 +92,7 @@ /* current namespace */ static struct namespace purge_namespace; +static int dryrun = 0; static int verbose = 1; static int forceall = 0; @@ -100,6 +101,8 @@ struct index_record *record, void *rock); static int usage(const char *name); +static void print_record(struct mailbox *mailbox, + struct index_record *record); static void print_stats(mbox_stats_t *stats); int main (int argc, char *argv[]) { @@ -112,7 +115,7 @@ fatal("must run as the Cyrus user", EC_USAGE); } - while ((option = getopt(argc, argv, "C:hxd:b:k:m:fsXio")) != EOF) { + while ((option = getopt(argc, argv, "C:hxd:b:k:m:fsXion")) != EOF) { switch (option) { case 'C': /* alt config file */ alt_config = optarg; @@ -141,6 +144,9 @@ } size = atoi(optarg) * 1048576; /* 1024 * 1024 */ } break; + case 'n' : { + dryrun = 1; + } break; case 'x' : { exact = 1; } break; @@ -221,7 +227,7 @@ static int usage(const char *name) { - printf("usage: %s [-f] [-s] [-C <alt_config>] [-x] [-X] [-i] [-o] {-d days | -b bytes|-k Kbytes|-m Mbytes}\n\t[mboxpattern1 ... [mboxpatternN]]\n", name); + printf("usage: %s [-f] [-s] [-C <alt_config>] [-x] [-X] [-i] [-o] [-n] {-d days | -b bytes|-k Kbytes|-m Mbytes}\n\t[mboxpattern1 ... [mboxpatternN]]\n", name); printf("\tthere are no defaults and at least one of -d, -b, -k, -m\n\tmust be specified\n"); printf("\tif no mboxpattern is given %s works on all mailboxes\n", name); printf("\t -x specifies an exact match for days or size\n"); @@ -230,6 +236,7 @@ printf("\t -X use delivery time instead of date header for date matches.\n"); printf("\t -i invert match logic: -x means not equal, date is for newer, size is for smaller.\n"); printf("\t -o only purge messages that are deleted.\n"); + printf("\t -n only print messages that would be deleted (dry run).\n"); exit(0); } @@ -282,9 +289,9 @@ /* thumbs up routine, checks date & size and returns yes or no for deletion */ /* 0 = no, 1 = yes */ -static unsigned purge_check(struct mailbox *mailbox __attribute__((unused)), - struct index_record *record, - void *deciderock) +static unsigned purge_check(struct mailbox *mailbox, + struct index_record *record, + void *deciderock) { time_t my_time; time_t senttime; @@ -308,11 +315,11 @@ if (((my_time - (time_t) senttime)/86400) == (days/86400)) { if (invertmatch) return 0; deleteit(record->size, stats); - return 1; + return dryrun ? print_record(mailbox, record), 0 : 1; } else { if (!invertmatch) return 0; deleteit(record->size, stats); - return 1; + return dryrun ? print_record(mailbox, record), 0 : 1; } } if (size >= 0) { @@ -320,11 +327,11 @@ if (record->size == (unsigned)size) { if (invertmatch) return 0; deleteit(record->size, stats); - return 1; + return dryrun ? print_record(mailbox, record), 0 : 1; } else { if (!invertmatch) return 0; deleteit(record->size, stats); - return 1; + return dryrun ? print_record(mailbox, record), 0 : 1; } } return 0; @@ -333,32 +340,58 @@ /* printf("comparing %ld :: %ld\n", my_time, the_record->sentdate); */ if (!invertmatch && ((my_time - (time_t) senttime) > days)) { deleteit(record->size, stats); - return 1; + return dryrun ? print_record(mailbox, record), 0 : 1; } if (invertmatch && ((my_time - (time_t) senttime) < days)) { deleteit(record->size, stats); - return 1; + return dryrun ? print_record(mailbox, record), 0 : 1; } } if (size >= 0) { /* check size */ if (!invertmatch && ((int) record->size > size)) { deleteit(record->size, stats); - return 1; + return dryrun ? print_record(mailbox, record), 0 : 1; } if (invertmatch && ((int) record->size < size)) { deleteit(record->size, stats); - return 1; + return dryrun ? print_record(mailbox, record), 0 : 1; } } return 0; } } +static void print_record(struct mailbox *mailbox, + struct index_record *record) +{ + printf("UID: %u\n", record->uid); + printf("\tSize: %u\n", record->size); + printf("\tSent: %s", ctime(&record->sentdate)); + printf("\tRecv: %s", ctime(&record->internaldate)); + + if (mailbox_cacherecord(mailbox, record)) { + printf("\tERROR: cache record missing or corrupt, " + "not printing cache details\n\n"); + return; + } + + printf("\tFrom: %.*s\n", cacheitem_size(record, CACHE_FROM), + cacheitem_base(record, CACHE_FROM)); + printf("\tTo : %.*s\n", cacheitem_size(record, CACHE_TO), + cacheitem_base(record, CACHE_TO)); + printf("\tCc : %.*s\n", cacheitem_size(record, CACHE_CC), + cacheitem_base(record, CACHE_CC)); + printf("\tBcc : %.*s\n", cacheitem_size(record, CACHE_BCC), + cacheitem_base(record, CACHE_BCC)); + printf("\tSubj: %.*s\n\n", cacheitem_size(record, CACHE_SUBJECT), + cacheitem_base(record, CACHE_SUBJECT)); +} + static void print_stats(mbox_stats_t *stats) { - printf("total messages \t\t %d\n",stats->total); - printf("total bytes \t\t %d\n",stats->total_bytes); + printf("Total messages \t\t %d\n",stats->total); + printf("Total bytes \t\t %d\n",stats->total_bytes); printf("Deleted messages \t\t %d\n",stats->deleted); printf("Deleted bytes \t\t %d\n",stats->deleted_bytes); printf("Remaining messages\t\t %d\n",stats->total - stats->deleted);
View file
cyrus-imapd-2.5.8.12.tar.gz/imap/mupdate.c -> cyrus-imapd-2.5.8.22.tar.gz/imap/mupdate.c
Changed
@@ -555,8 +555,10 @@ database_init(); #ifdef HAVE_SSL +#if OPENSSL_VERSION_NUMBER < 0x10100000L CRYPTO_thread_setup(); #endif +#endif if (!masterp) { r = pthread_create(&t, NULL, &mupdate_client_start, NULL); @@ -604,8 +606,10 @@ void service_abort(int error) { #ifdef HAVE_SSL +#if OPENSSL_VERSION_NUMBER < 0x10100000L CRYPTO_thread_cleanup(); #endif +#endif shut_down(error); }
View file
cyrus-imapd-2.5.8.12.tar.gz/imap/tls.c -> cyrus-imapd-2.5.8.22.tar.gz/imap/tls.c
Changed
@@ -206,6 +206,7 @@ } } +#if OPENSSL_VERSION_NUMBER < 0x10100000L /* taken from OpenSSL apps/s_cb.c not thread safe! */ static RSA *tmp_rsa_cb(SSL * s __attribute__((unused)), @@ -219,26 +220,51 @@ } return (rsa_tmp); } +#endif + +#if OPENSSL_VERSION_NUMBER < 0x10100000L +/* replacements for new 1.1 API accessors */ +/* XXX probably put these somewhere central */ +static int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) +{ + if (p == NULL || g == NULL) return 0; + dh->p = p; + dh->q = q; /* optional */ + dh->g = g; + return 1; +} +#endif #if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) /* Logic copied from OpenSSL apps/s_server.c: give the TLS context * DH params to work with DHE-* cipher suites. Hardcoded fallback * in case no DH params in server_key or server_cert. + * Modified quite a bit for openssl 1.1.0 compatibility. + * XXX we might be able to just replace this with DH_get_1024_160? + * XXX the apps/s_server.c example doesn't use this anymore at all. */ static DH *get_dh1024(void) { /* Second Oakley group 1024-bits MODP group from RFC2409 */ - DH *dh=NULL; + DH *dh; + BIGNUM *p = NULL, *g = NULL; - if ((dh=DH_new()) == NULL) return(NULL); - dh->p=get_rfc2409_prime_1024(NULL); - dh->g=NULL; - BN_dec2bn(&(dh->g), "2"); - if ((dh->p == NULL) || (dh->g == NULL)) return(NULL); + dh = DH_new(); + if (!dh) return NULL; - return(dh); - + p = get_rfc2409_prime_1024(NULL); + BN_dec2bn(&g, "2"); + + if (DH_set0_pqg(dh, p, NULL, g)) + return dh; + + if (g) BN_free(g); + if (p) BN_free(p); + DH_free(dh); + + return NULL; } + static DH *load_dh_param(const char *keyfile, const char *certfile) { DH *ret=NULL; @@ -292,9 +318,9 @@ verify_error = X509_V_ERR_CERT_CHAIN_TOO_LONG; } } - switch (ctx->error) { + switch (err) { case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: - X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert), buf, sizeof(buf)); + X509_NAME_oneline(X509_get_issuer_name(err_cert), buf, sizeof(buf)); syslog(LOG_NOTICE, "issuer= %s", buf); break; case X509_V_ERR_CERT_NOT_YET_VALID: @@ -463,6 +489,8 @@ time_t expire; int ret = -1; unsigned char *asn; + const unsigned char *session_id = NULL; + unsigned int session_id_length = 0; assert(sess); @@ -488,9 +516,11 @@ if (len) { /* store the session in our database */ + + session_id = SSL_SESSION_get_id(sess, &session_id_length); do { - ret = cyrusdb_store(sessdb, (const char *) sess->session_id, - sess->session_id_length, + ret = cyrusdb_store(sessdb, (const char *) session_id, + session_id_length, (const char *) data, len + sizeof(time_t), NULL); } while (ret == CYRUSDB_AGAIN); } @@ -501,8 +531,8 @@ if (var_imapd_tls_loglevel > 0) { unsigned int i; char idstr[SSL_MAX_SSL_SESSION_ID_LENGTH*2 + 1]; - for (i = 0; i < sess->session_id_length; i++) { - sprintf(idstr+i*2, "%02X", sess->session_id[i]); + for (i = 0; i < session_id_length; i++) { + sprintf(idstr+i*2, "%02X", session_id[i]); } syslog(LOG_DEBUG, "new TLS session: id=%s, expire=%s, status=%s", idstr, ctime(&expire), ret ? "failed" : "ok"); @@ -514,7 +544,7 @@ /* * Function for removing a session from our database. */ -static void remove_session(unsigned char *id, int idlen) +static void remove_session(const unsigned char *id, int idlen) { int ret; @@ -545,9 +575,14 @@ static void remove_session_cb(SSL_CTX *ctx __attribute__((unused)), SSL_SESSION *sess) { + const unsigned char *session_id = NULL; + unsigned int session_id_length = 0; + assert(sess); - remove_session(sess->session_id, sess->session_id_length); + session_id = SSL_SESSION_get_id(sess, &session_id_length); + + remove_session(session_id, session_id_length); } /* @@ -556,8 +591,13 @@ * called, also when session caching was disabled. We lookup the * session in our database in case it was stored by another process. */ +#if OPENSSL_VERSION_NUMBER >= 0x10100000L +static SSL_SESSION *get_session_cb(SSL *ssl __attribute__((unused)), + const unsigned char *id, int idlen, int *copy) +#else static SSL_SESSION *get_session_cb(SSL *ssl __attribute__((unused)), unsigned char *id, int idlen, int *copy) +#endif { int ret; const char *data = NULL; @@ -836,7 +876,9 @@ return (-1); } +#if OPENSSL_VERSION_NUMBER < 0x10100000L SSL_CTX_set_tmp_rsa_callback(s_ctx, tmp_rsa_cb); +#endif #if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) /* Load DH params for DHE-* key exchanges */ @@ -1439,7 +1481,9 @@ } } +#if OPENSSL_VERSION_NUMBER < 0x10100000L SSL_CTX_set_tmp_rsa_callback(c_ctx, tmp_rsa_cb); +#endif verify_depth = verifydepth; SSL_CTX_set_verify(c_ctx, verify_flags, verify_callback);
View file
cyrus-imapd-2.5.8.12.tar.gz/imap/tls_th-lock.c -> cyrus-imapd-2.5.8.22.tar.gz/imap/tls_th-lock.c
Changed
@@ -14,6 +14,12 @@ #ifdef HAVE_SSL +/* + * This entire interface is obsoleted by OpenSSL 1.1.0. + * Keep it around for a while for backward compatibility though. + */ +#if OPENSSL_VERSION_NUMBER < 0x10100000L + static pthread_mutex_t *lock_cs; static long *lock_count; @@ -69,4 +75,6 @@ return(ret); } +#endif /* OPENSSL_VERSION_NUMBER */ + #endif /* HAVE_SSL */
View file
cyrus-imapd-2.5.8.12.tar.gz/imap/tls_th-lock.h -> cyrus-imapd-2.5.8.22.tar.gz/imap/tls_th-lock.h
Changed
@@ -9,6 +9,12 @@ #ifdef HAVE_SSL +/* + * This entire interface is obsoleted by OpenSSL 1.1.0. + * Keep it around for a while for backward compatibility though. + */ +#if OPENSSL_VERSION_NUMBER < 0x10100000L + void CRYPTO_thread_setup(void); void CRYPTO_thread_cleanup(void); /* @@ -18,5 +24,7 @@ void pthreads_locking_callback(int mode,int type,char *file,int line); unsigned long pthreads_thread_id(void ); +#endif /* OPENSSL_VERSION_NUMBER */ + #endif /* HAVE_SSL */ #endif /* INCLUDED_TLS_TH_LOCK_H */
View file
cyrus-imapd-2.5.8.12.tar.gz/imtest/imtest.c -> cyrus-imapd-2.5.8.22.tar.gz/imtest/imtest.c
Changed
@@ -374,9 +374,9 @@ verify_error = X509_V_ERR_CERT_CHAIN_TOO_LONG; } } - switch (ctx->error) { + switch (err) { case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: - X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert), buf, 256); + X509_NAME_oneline(X509_get_issuer_name(err_cert), buf, 256); printf("issuer= %s\n", buf); break; case X509_V_ERR_CERT_NOT_YET_VALID: @@ -396,8 +396,8 @@ } +#if OPENSSL_VERSION_NUMBER < 0x10100000L /* taken from OpenSSL apps/s_cb.c */ - static RSA *tmp_rsa_cb(SSL * s __attribute__((unused)), int export __attribute__((unused)), int keylength) { @@ -408,6 +408,7 @@ } return (rsa_tmp); } +#endif /* taken from OpenSSL apps/s_cb.c * tim - this seems to just be giving logging messages @@ -536,7 +537,9 @@ printf("TLS engine: cannot load cert/key data, may be a cert/key mismatch?\n"); return IMTEST_FAIL; } +#if OPENSSL_VERSION_NUMBER < 0x10100000L SSL_CTX_set_tmp_rsa_callback(tls_ctx, tmp_rsa_cb); +#endif verify_depth = verifydepth; SSL_CTX_set_verify(tls_ctx, verify_flags, verify_callback);
View file
cyrus-imapd-2.5.8.12.tar.gz/lib/acl_afs.c -> cyrus-imapd-2.5.8.22.tar.gz/lib/acl_afs.c
Changed
@@ -114,6 +114,9 @@ int oldaccess = 0; char *rights; + if (!identifier) + return -1; + /* Convert 'identifier' into canonical form */ canonid = auth_canonifyid(*identifier == '-' ? identifier+1 : identifier, 0); if (canonid) {
View file
cyrus-imapd-2.5.8.12.tar.gz/lib/imclient.c -> cyrus-imapd-2.5.8.22.tar.gz/lib/imclient.c
Changed
@@ -1552,9 +1552,9 @@ verify_error = X509_V_ERR_CERT_CHAIN_TOO_LONG; } } - switch (ctx->error) { + switch (err) { case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: - X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert), + X509_NAME_oneline(X509_get_issuer_name(err_cert), buf, sizeof(buf)); printf("issuer= %s\n", buf); break; @@ -1575,6 +1575,7 @@ } +#if OPENSSL_VERSION_NUMBER < 0x10100000L /* taken from OpenSSL apps/s_cb.c */ static RSA *tmp_rsa_cb(SSL *s __attribute__((unused)), int export __attribute__((unused)), @@ -1587,6 +1588,7 @@ } return (rsa_tmp); } +#endif /* * Seed the random number generator. @@ -1675,7 +1677,10 @@ printf("[ TLS engine: cannot load cert/key data, may be a cert/key mismatch]\n"); return -1; } + +#if OPENSSL_VERSION_NUMBER < 0x10100000L SSL_CTX_set_tmp_rsa_callback(imclient->tls_ctx, tmp_rsa_cb); +#endif verify_depth = verifydepth; SSL_CTX_set_verify(imclient->tls_ctx, verify_flags, verify_callback);
View file
cyrus-imapd-2.5.8.12.tar.gz/lib/stristr.c -> cyrus-imapd-2.5.8.22.tar.gz/lib/stristr.c
Changed
@@ -23,10 +23,6 @@ #include "config.h" -#ifndef _AIX -typedef unsigned int uint; -#endif - #if defined(__cplusplus) && __cplusplus extern "C" { #endif @@ -34,7 +30,7 @@ EXPORTED char *stristr(const char *String, const char *Pattern) { char *pptr, *sptr, *start; - uint slen, plen; + size_t slen, plen; for (start = (char *)String, pptr = (char *)Pattern,
View file
cyrus-imapd-2.5.8.12.tar.gz/man/ipurge.8 -> cyrus-imapd-2.5.8.22.tar.gz/man/ipurge.8
Changed
@@ -65,6 +65,9 @@ [ .B \-o ] +[ +.B \-n +] .br [ .BI \-d " days" @@ -133,6 +136,9 @@ .TP .B \-o Only purge messages that have the \\Deleted flag set. +.TP +.B \-n +Only print messages that would be deleted (dry run). .SH FILES .TP .B /etc/imapd.conf
View file
cyrus-imapd-2.5.8.12.tar.gz/xversion.h -> cyrus-imapd-2.5.8.22.tar.gz/xversion.h
Changed
@@ -1,3 +1,3 @@ -/* cyrus-imapd 2.5.8.12 */ -#define _CYRUS_VERSION "2.5.8.12" -#define CYRUS_GITVERSION "fb7ae876 2016-06-02" +/* cyrus-imapd 2.5.8.22 */ +#define _CYRUS_VERSION "2.5.8.22" +#define CYRUS_GITVERSION "f1affb9b 2016-07-01"
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.