Some fixes from upstream:

- imap: Fixed a memory leak in ESEARCH.
- imap/pop3-login: Don't crash if passdb returns proxy field without host.
- lib-index: Added a missing sanity check for expunge-guid record's uid.
  This fixes a non-self healing assert-crash.
- master: Delete also pipes from login_dir (left by v2.0).

From Brad (maintainer), ok ajacoutot@
This commit is contained in:
pea 2011-01-04 13:59:17 +00:00
parent 1a32ebe872
commit fe29c7c3f5
6 changed files with 85 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.157 2010/11/26 14:44:27 espie Exp $
# $OpenBSD: Makefile,v 1.158 2011/01/04 13:59:17 pea Exp $
SHARED_ONLY= Yes
@ -12,7 +12,7 @@ V_MANAGESIEVE= 0.11.12
PKGNAME= dovecot-${V_DOVECOT}
PKGNAME-server= dovecot-${V_DOVECOT}
REVISION-server=1
REVISION-server=2
FULLPKGNAME-sieve= dovecot-sieve-${V_SIEVE}
REVISION-sieve= 0
EPOCH-sieve= 0

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_imap-login_imap-proxy_c,v 1.3 2011/01/04 13:59:17 pea Exp $
--- src/imap-login/imap-proxy.c.orig Thu Dec 9 17:39:21 2010
+++ src/imap-login/imap-proxy.c Thu Dec 9 17:41:00 2010
@@ -436,6 +436,11 @@ int imap_proxy_new(struct imap_client *client, const c
client_send_tagline(client, PROXY_FAILURE_MSG);
return -1;
}
+ if (host == NULL || *host == '\0') {
+ client_syslog_err(&client->common, "proxy: host not given");
+ client_send_tagline(client, PROXY_FAILURE_MSG);
+ return -1;
+ }
i_assert(client->refcount > 1);
connection_queue_add(1);

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-src_imap_imap-search_c,v 1.1 2011/01/04 13:59:17 pea Exp $
--- src/imap/imap-search.c.orig Thu Dec 9 17:37:18 2010
+++ src/imap/imap-search.c Thu Dec 9 17:37:44 2010
@@ -283,6 +283,7 @@ static void imap_search_send_result(struct imap_search
}
str_append(str, "\r\n");
o_stream_send(client->output, str_data(str), str_len(str));
+ str_free(&str);
}
static void search_update_mail(struct imap_search_context *ctx)

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-src_lib-index_mail-index-sync-update_c,v 1.1 2011/01/04 13:59:17 pea Exp $
--- src/lib-index/mail-index-sync-update.c.orig Sun Dec 5 18:18:06 2010
+++ src/lib-index/mail-index-sync-update.c Sun Dec 5 18:18:45 2010
@@ -528,8 +528,15 @@ int mail_index_sync_record(struct mail_index_sync_map_
break;
}
end = CONST_PTR_OFFSET(data, hdr->size);
- for (; rec != end; rec++)
+ for (; rec != end; rec++) {
+ if (rec->uid == 0) {
+ mail_index_sync_set_corrupted(ctx,
+ "Expunge-guid for invalid uid=%u",
+ rec->uid);
+ break;
+ }
sync_expunge(ctx, rec->uid, rec->uid);
+ }
break;
}
case MAIL_TRANSACTION_FLAG_UPDATE: {

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-src_master_master-settings_c,v 1.10 2011/01/04 13:59:17 pea Exp $
--- src/master/master-settings.c.orig Thu Dec 9 17:29:09 2010
+++ src/master/master-settings.c Thu Dec 9 17:29:09 2010
@@ -649,7 +649,8 @@ static void unlink_auth_sockets(const char *path, cons
i_error("lstat(%s) failed: %m", str_c(str));
continue;
}
- if (!S_ISSOCK(st.st_mode))
+ /* delete also FIFOs created by v2.0 */
+ if (!S_ISSOCK(st.st_mode) && !S_ISFIFO(st.st_mode))
continue;
/* try to avoid unlinking sockets if someone's already
@@ -657,7 +658,7 @@ static void unlink_auth_sockets(const char *path, cons
when SIGHUPing a child process might catch the new
connection before it notices that it's supposed
to die. null_fd == -1 check is a bit kludgy, but works.. */
- if (null_fd == -1) {
+ if (null_fd == -1 && S_ISSOCK(st.st_mode)) {
int fd = net_connect_unix(str_c(str));
if (fd != -1 || errno != ECONNREFUSED) {
i_fatal("Dovecot is already running? "

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_pop3-login_pop3-proxy_c,v 1.3 2011/01/04 13:59:17 pea Exp $
--- src/pop3-login/pop3-proxy.c.orig Thu Dec 9 17:41:09 2010
+++ src/pop3-login/pop3-proxy.c Thu Dec 9 17:41:24 2010
@@ -271,6 +271,11 @@ int pop3_proxy_new(struct pop3_client *client, const c
client_send_line(client, PROXY_FAILURE_MSG);
return -1;
}
+ if (host == NULL || *host == '\0') {
+ client_syslog_err(&client->common, "proxy: host not given");
+ client_send_line(client, PROXY_FAILURE_MSG);
+ return -1;
+ }
i_assert(client->refcount > 1);
connection_queue_add(1);