summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2008-11-17 20:11:28 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2008-11-17 20:11:28 +0000
commit321754a01ff9acd980c71846305edad67b6e4b95 (patch)
treebd8a5fd75ff566cc259e943b0d2669f3d6614b84
parent9ee559536e7325785bd1bab82ae1423945f43bae (diff)
- remove several constructs where format strings are used in an evbuffer
printf with constant parameters, turn them into a constant string. - when client sends EHLO without a parameter, send the appropriate error message ("EHLO takes ..." instead of "HELO takes ...") From Jacek Masiulaniec <jacekm@dobremiasto.net>
-rw-r--r--usr.sbin/smtpd/smtp_session.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index 4bd9d06f7c2..3f32e2905cd 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.5 2008/11/11 01:08:08 gilles Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.6 2008/11/17 20:11:27 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -263,7 +263,7 @@ session_rfc5321_ehlo_handler(struct session *s, char *args)
if (args == NULL) {
evbuffer_add_printf(s->s_bev->output,
- "501 HELO requires domain address.\r\n");
+ "501 EHLO requires domain address.\r\n");
return 1;
}
@@ -340,14 +340,14 @@ session_rfc5321_mail_handler(struct session *s, char *args)
if (strlcpy(buffer, args, sizeof(buffer)) >= sizeof(buffer)) {
evbuffer_add_printf(s->s_bev->output,
- "%d %s\r\n", 553, "Syntax error for sender address");
+ "553 Syntax error for sender address\r\n");
return 1;
}
if (! session_set_path(&s->s_msg.sender, buffer)) {
/* No need to even transmit to MFA, path is invalid */
evbuffer_add_printf(s->s_bev->output,
- "%d %s\r\n", 553, "Syntax error for sender address");
+ "553 Syntax error for sender address\r\n");
return 1;
}
@@ -389,14 +389,14 @@ session_rfc5321_rcpt_handler(struct session *s, char *args)
if (strlcpy(buffer, args, sizeof(buffer)) >= sizeof(buffer)) {
evbuffer_add_printf(s->s_bev->output,
- "%d %s\r\n", 553, "Syntax error for recipient address");
+ "553 Syntax error for recipient address\r\n");
return 1;
}
if (! session_set_path(&mr.path, buffer)) {
/* No need to even transmit to MFA, path is invalid */
evbuffer_add_printf(s->s_bev->output,
- "%d %s\r\n", 553, "Syntax error for recipient address");
+ "553 Syntax error for recipient address\r\n");
return 1;
}
@@ -637,14 +637,12 @@ session_pickup(struct session *s, struct submit_status *ss)
case S_DATA:
if (s->s_msg.datafp == NULL) {
evbuffer_add_printf(s->s_bev->output,
- "%d %s\r\n", 421,
- "Service temporarily unavailable");
+ "421 Service temporarily unavailable\r\n");
return;
}
s->s_state = S_DATACONTENT;
evbuffer_add_printf(s->s_bev->output,
- "%d %s\r\n", 354,
- "Enter mail, end with \".\" on a line by itself");
+ "354 Enter mail, end with \".\" on a line by itself\r\n");
break;
case S_DATACONTENT: