diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-05-20 16:12:12 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-05-20 16:12:12 +0000 |
commit | 82274dabef232f01b6c5f0c13255d02765795abf (patch) | |
tree | 5c073784897e4d6f57bb8583d0e056cab6fd37d4 /usr.sbin | |
parent | 5cc1cca10767a989b5770181c0fe0af68a22dcfb (diff) |
Delay enabling of EV_READ until S_INIT (smtps) or S_TLS (starttls).
ok gilles@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/smtp_session.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index 0c0cc520a25..05a2ea99793 100644 --- a/usr.sbin/smtpd/smtp_session.c +++ b/usr.sbin/smtpd/smtp_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_session.c,v 1.92 2009/05/20 14:29:44 gilles Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.93 2009/05/20 16:12:11 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -617,6 +617,9 @@ session_pickup(struct session *s, struct submit_status *ss) break; case S_TLS: + if (s->s_flags & F_WRITEONLY) + fatalx("session_pickup: corrupt session"); + bufferevent_enable(s->s_bev, EV_READ); s->s_state = S_GREETED; break; @@ -723,8 +726,6 @@ session_bufferevent_new(struct session *s) bufferevent_settimeout(s->s_bev, SMTPD_SESSION_TIMEOUT, SMTPD_SESSION_TIMEOUT); - - bufferevent_enable(s->s_bev, EV_READ); } void |