From c1b340c76c86ed78df8c1ba5bfb5fdf1a6b01d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Wed, 22 Aug 2018 16:34:47 +0200 Subject: [PATCH] Removed unused patches and de-fuzzified dlopen-localscan patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jaroslav Škarvada --- exim-4.84-mime-fix.patch | 208 -------------------------- exim-4.84.2-environment.patch | 23 --- exim-4.90.1-dec64table-read-fix.patch | 16 -- exim-4.91-dlopen-localscan.patch | 4 +- 4 files changed, 2 insertions(+), 249 deletions(-) delete mode 100644 exim-4.84-mime-fix.patch delete mode 100644 exim-4.84.2-environment.patch delete mode 100644 exim-4.90.1-dec64table-read-fix.patch diff --git a/exim-4.84-mime-fix.patch b/exim-4.84-mime-fix.patch deleted file mode 100644 index 7b72b51..0000000 --- a/exim-4.84-mime-fix.patch +++ /dev/null @@ -1,208 +0,0 @@ -diff --git a/src/mime.c b/src/mime.c -index 95d3da4..a61e9f2 100644 ---- a/src/mime.c -+++ b/src/mime.c -@@ -528,26 +528,24 @@ while(1) - */ - if (context != NULL) - { -- while(fgets(CS header, MIME_MAX_HEADER_SIZE, f) != NULL) -+ while(fgets(CS header, MIME_MAX_HEADER_SIZE, f)) - { - /* boundary line must start with 2 dashes */ -- if (Ustrncmp(header,"--",2) == 0) -- { -- if (Ustrncmp((header+2),context->boundary,Ustrlen(context->boundary)) == 0) -+ if ( Ustrncmp(header, "--", 2) == 0 -+ && Ustrncmp(header+2, context->boundary, Ustrlen(context->boundary)) == 0) -+ { -+ /* found boundary */ -+ if (Ustrncmp((header+2+Ustrlen(context->boundary)), "--", 2) == 0) - { -- /* found boundary */ -- if (Ustrncmp((header+2+Ustrlen(context->boundary)),"--",2) == 0) -- { -- /* END boundary found */ -- debug_printf("End boundary found %s\n", context->boundary); -- return rc; -- } -- else -- debug_printf("Next part with boundary %s\n", context->boundary); -- -- /* can't use break here */ -- goto DECODE_HEADERS; -+ /* END boundary found */ -+ debug_printf("End boundary found %s\n", context->boundary); -+ return rc; - } -+ else -+ debug_printf("Next part with boundary %s\n", context->boundary); -+ -+ /* can't use break here */ -+ goto DECODE_HEADERS; - } - } - /* Hit EOF or read error. Ugh. */ -@@ -557,86 +555,103 @@ while(1) - - DECODE_HEADERS: - /* parse headers, set up expansion variables */ -- while (mime_get_header(f,header)) -+ while (mime_get_header(f, header)) - { - int i; - /* loop through header list */ - for (i = 0; i < mime_header_list_size; i++) -- { -- uschar *header_value = NULL; -- int header_value_len = 0; -- -- /* found an interesting header? */ -- if (strncmpic(mime_header_list[i].name,header,mime_header_list[i].namelen) == 0) -- { -- uschar *p = header + mime_header_list[i].namelen; -- /* yes, grab the value (normalize to lower case) -- and copy to its corresponding expansion variable */ -+ if (strncmpic(mime_header_list[i].name, -+ header, mime_header_list[i].namelen) == 0) -+ { /* found an interesting header */ -+ uschar * header_value; -+ int header_value_len; -+ uschar * p = header + mime_header_list[i].namelen; -+ -+ /* grab the value (normalize to lower case) -+ and copy to its corresponding expansion variable */ - while(*p != ';') - { - *p = tolower(*p); - p++; - } -- header_value_len = (p - (header + mime_header_list[i].namelen)); -- header_value = (uschar *)malloc(header_value_len+1); -- memset(header_value,0,header_value_len+1); -+ header_value_len = p - (header + mime_header_list[i].namelen); - p = header + mime_header_list[i].namelen; -- Ustrncpy(header_value, p, header_value_len); -- debug_printf("Found %s MIME header, value is '%s'\n", mime_header_list[i].name, header_value); -+ header_value = string_copyn(p, header_value_len); -+ debug_printf("Found %s MIME header, value is '%s'\n", -+ mime_header_list[i].name, header_value); - *((uschar **)(mime_header_list[i].value)) = header_value; - - /* make p point to the next character after the closing ';' */ -- p += (header_value_len+1); -+ p += header_value_len+1; - -- /* grab all param=value tags on the remaining line, check if they are interesting */ -+ /* grab all param=value tags on the remaining line, -+ check if they are interesting */ - NEXT_PARAM_SEARCH: -- while (*p != 0) -+ while (*p) - { - mime_parameter * mp; - for (mp = mime_parameter_list; - mp < &mime_parameter_list[mime_parameter_list_size]; - mp++) - { -- uschar *param_value = NULL; -- int param_value_len = 0; -+ uschar * param_value = NULL; - - /* found an interesting parameter? */ - if (strncmpic(mp->name, p, mp->namelen) == 0) - { -- uschar *q = p + mp->namelen; -+ uschar * q = p + mp->namelen; -+ int plen = 0; - int size = 0; - int ptr = 0; - - /* yes, grab the value and copy to its corresponding expansion variable */ - while(*q && *q != ';') /* ; terminates */ -- { - if (*q == '"') - { - q++; /* skip leading " */ -- while(*q && *q != '"') /* which protects ; */ -+ plen++; /* and account for the skip */ -+ while(*q && *q != '"') /* " protects ; */ -+ { - param_value = string_cat(param_value, &size, &ptr, q++, 1); -- if (*q) q++; /* skip trailing " */ -+ plen++; -+ } -+ if (*q) -+ { -+ q++; /* skip trailing " */ -+ plen++; -+ } - } - else -+ { - param_value = string_cat(param_value, &size, &ptr, q++, 1); -- } -- param_value[ptr++] = '\0'; -- param_value_len = ptr; -+ plen++; -+ } -+ -+ if (param_value) -+ { -+ param_value[ptr++] = '\0'; - -- param_value = rfc2047_decode(param_value, check_rfc2047_length, NULL, 32, ¶m_value_len, &q); -- debug_printf("Found %s MIME parameter in %s header, value is '%s'\n", mp->name, mime_header_list[i].name, param_value); -- *((uschar **)(mp->value)) = param_value; -- p += (mp->namelen + param_value_len + 1); -+ param_value = rfc2047_decode(param_value, -+ check_rfc2047_length, NULL, 32, NULL, &q); -+ debug_printf("Found %s MIME parameter in %s header, " -+ "value is '%s'\n", mp->name, mime_header_list[i].name, -+ param_value); -+ } -+ *mp->value = param_value; -+ p += mp->namelen + plen + 1; /* name=, content, ; */ - goto NEXT_PARAM_SEARCH; - } - } - /* There is something, but not one of our interesting parameters. - Advance to the next semicolon */ -- while(*p != ';') p++; -+ while(*p != ';') -+ { -+ if (*p == '"') while(*++p && *p != '"') ; -+ p++; -+ } - p++; - } - } -- } - } - - /* set additional flag variables (easier access) */ -diff --git a/src/mime.h b/src/mime.h -index abf68da..af09f67 100644 ---- a/src/mime.h -+++ b/src/mime.h -@@ -40,15 +40,15 @@ static int mime_header_list_size = sizeof(mime_header_list)/sizeof(mime_header); - - - typedef struct mime_parameter { -- uschar *name; -- int namelen; -- void *value; -+ uschar * name; -+ int namelen; -+ uschar ** value; - } mime_parameter; - - static mime_parameter mime_parameter_list[] = { -- { US"name=", 5, &mime_filename }, -+ { US"name=", 5, &mime_filename }, - { US"filename=", 9, &mime_filename }, -- { US"charset=", 8, &mime_charset }, -+ { US"charset=", 8, &mime_charset }, - { US"boundary=", 9, &mime_boundary } - }; - diff --git a/exim-4.84.2-environment.patch b/exim-4.84.2-environment.patch deleted file mode 100644 index 255c5ce..0000000 --- a/exim-4.84.2-environment.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/src/configure.default b/src/configure.default -index d1c94ad..d264c9a 100644 ---- a/src/configure.default -+++ b/src/configure.default -@@ -334,6 +334,18 @@ timeout_frozen_after = 7d - # accept_8bitmime = false - - -+# Exim does not make use of environment variables itself. However, -+# libraries that Exim uses (e.g. LDAP) depend on specific environment settings. -+# There are two lists: keep_environment for the variables we trust, and -+# add_environment for variables we want to set to a specific value. -+# Note that TZ is handled separateley by the timezone runtime option -+# and TIMEZONE_DEFAULT buildtime option. -+ -+keep_environment = ^LDAP -+add_environment = PATH=/usr/bin::/bin -+ -+ -+ - ###################################################################### - # ACL CONFIGURATION # - # Specifies access control lists for incoming SMTP mail # diff --git a/exim-4.90.1-dec64table-read-fix.patch b/exim-4.90.1-dec64table-read-fix.patch deleted file mode 100644 index d13bd50..0000000 --- a/exim-4.90.1-dec64table-read-fix.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/src/base64.c b/src/src/base64.c -index dbbd6a4..e63522e 100644 ---- a/src/base64.c -+++ b/src/base64.c -@@ -173,7 +173,7 @@ while ((x = *code++) != 0) - - while (isspace(y = *code++)) ; - /* debug_printf("b64d: '%c'\n", y); */ -- if (y == 0 || (y = dec64table[y]) == 255) -+ if (y > 127 || (y = dec64table[y]) == 255) - return -1; - - *result++ = (x << 2) | (y >> 4); --- -1.9.1 - diff --git a/exim-4.91-dlopen-localscan.patch b/exim-4.91-dlopen-localscan.patch index c8db483..b6a83a3 100644 --- a/exim-4.91-dlopen-localscan.patch +++ b/exim-4.91-dlopen-localscan.patch @@ -1,8 +1,8 @@ diff --git a/src/EDITME b/src/EDITME -index 4cd3b4d..1b79e71 100644 +index 25d96ce..6f8e99f 100644 --- a/src/EDITME +++ b/src/EDITME -@@ -817,6 +817,20 @@ TLS_LIBS=-lssl -lcrypto +@@ -818,6 +818,20 @@ TLS_LIBS=-lssl -lcrypto # specified in INCLUDE.