aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilles Chehade <gilles@poolp.org>2017-08-06 23:28:42 +0200
committerGilles Chehade <gilles@poolp.org>2017-08-06 23:28:42 +0200
commit8de0e39ffea6659b81b9ce30876d77ff4510ae66 (patch)
tree16be7b1b6d5137c8149d971637a05dfaebef1474
parentsync with openbsd (diff)
downloadOpenSMTPD-8de0e39ffea6659b81b9ce30876d77ff4510ae66.tar.xz
OpenSMTPD-8de0e39ffea6659b81b9ce30876d77ff4510ae66.zip
fix flags masking for PURGE and remove envelope upgrade codeopensmtpd-201801101413
-rw-r--r--smtpd/envelope.c59
-rw-r--r--smtpd/smtpctl/CVS/Entries2
-rw-r--r--smtpd/smtpd.h4
-rw-r--r--smtpd/smtpd/CVS/Entries2
4 files changed, 6 insertions, 61 deletions
diff --git a/smtpd/envelope.c b/smtpd/envelope.c
index 539efda6..4e0ad6b8 100644
--- a/smtpd/envelope.c
+++ b/smtpd/envelope.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: envelope.c,v 1.36 2015/12/28 22:08:30 jung Exp $ */
+/* $OpenBSD: envelope.c,v 1.37 2017/08/06 08:35:14 gilles Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -45,7 +45,6 @@
#include "smtpd.h"
#include "log.h"
-static int envelope_upgrade_v1(struct dict *);
static int envelope_ascii_load(struct envelope *, struct dict *);
static void envelope_ascii_dump(const struct envelope *, char **, size_t *,
const char *);
@@ -152,21 +151,7 @@ envelope_load_buffer(struct envelope *ep, const char *ibuf, size_t buflen)
goto end;
}
- switch (version) {
- case 1:
- log_debug("debug: upgrading envelope to version 1");
- if (!envelope_upgrade_v1(&d)) {
- log_debug("debug: failed to upgrade "
- "envelope to version 1");
- goto end;
- }
- /* FALLTRHOUGH */
- case 2:
- /* Can be missing in some v2 envelopes */
- if (dict_get(&d, "smtpname") == NULL)
- dict_xset(&d, "smtpname", env->sc_hostname);
- break;
- default:
+ if (version != 2) {
log_debug("debug: bad envelope version %lld", version);
goto end;
}
@@ -951,43 +936,3 @@ envelope_ascii_dump(const struct envelope *ep, char **dest, size_t *len,
err:
*dest = NULL;
}
-
-static int
-envelope_upgrade_v1(struct dict *d)
-{
- static char buf_relay[1024];
- char *val;
-
- /*
- * very very old envelopes had a "msgid" field
- */
- dict_pop(d, "msgid");
-
- /*
- * rename "mta-relay-helo" field to "mta-relay-helotable"
- */
- if ((val = dict_get(d, "mta-relay-helo"))) {
- dict_xset(d, "mta-relay-helotable", val);
- dict_xpop(d, "mta-relay-helo");
- }
-
- /*
- * "ssl" becomes "secure" in "mta-relay" scheme
- */
- if ((val = dict_get(d, "mta-relay"))) {
- if (strncasecmp("ssl://", val, 6) == 0) {
- if (!bsnprintf(buf_relay, sizeof(buf_relay),
- "secure://%s", val+6))
- return (0);
- dict_set(d, "mta-relay", buf_relay);
- }
- else if (strncasecmp("ssl+auth://", val, 11) == 0) {
- if (!bsnprintf(buf_relay, sizeof(buf_relay),
- "secure+auth://%s", val+11))
- return (0);
- dict_set(d, "mta-relay", buf_relay);
- }
- }
-
- return (1);
-}
diff --git a/smtpd/smtpctl/CVS/Entries b/smtpd/smtpctl/CVS/Entries
index b82bc161..02ff43ca 100644
--- a/smtpd/smtpctl/CVS/Entries
+++ b/smtpd/smtpctl/CVS/Entries
@@ -1,2 +1,2 @@
-/Makefile/1.45/Mon Jul 31 21:07:37 2017//
+/Makefile/1.45/Tue Aug 1 21:13:51 2017//
D
diff --git a/smtpd/smtpd.h b/smtpd/smtpd.h
index 4474f447..39f9e136 100644
--- a/smtpd/smtpd.h
+++ b/smtpd/smtpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.h,v 1.533 2017/07/27 18:48:30 sunil Exp $ */
+/* $OpenBSD: smtpd.h,v 1.534 2017/08/04 14:38:49 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -1150,7 +1150,7 @@ int uncompress_file(FILE *, FILE *);
#define PURGE_RULES 0x04
#define PURGE_PKI 0x08
#define PURGE_PKI_KEYS 0x10
-#define PURGE_EVERYTHING 0x0f
+#define PURGE_EVERYTHING 0xff
void purge_config(uint8_t);
void config_process(enum smtp_proc_type);
void config_peer(enum smtp_proc_type);
diff --git a/smtpd/smtpd/CVS/Entries b/smtpd/smtpd/CVS/Entries
index ff39838b..8a84585e 100644
--- a/smtpd/smtpd/CVS/Entries
+++ b/smtpd/smtpd/CVS/Entries
@@ -1,2 +1,2 @@
-/Makefile/1.87/Fri May 26 21:42:52 2017//
+/Makefile/1.87/Tue Aug 1 21:16:01 2017//
D