Hello community, here is the log from the commit of package imapfilter for openSUSE:Factory checked in at 2020-11-17 21:25:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/imapfilter (Old) and /work/SRC/openSUSE:Factory/.imapfilter.new.24930 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "imapfilter" Tue Nov 17 21:25:15 2020 rev:45 rq:848757 version:2.7.3 Changes: -------- --- /work/SRC/openSUSE:Factory/imapfilter/imapfilter.changes 2020-01-12 23:25:42.626845559 +0100 +++ /work/SRC/openSUSE:Factory/.imapfilter.new.24930/imapfilter.changes 2020-11-17 21:25:17.297377978 +0100 @@ -1,0 +2,20 @@ +Sat Nov 14 23:49:42 UTC 2020 - Arun Persaud <[email protected]> + +- update to version 2.7.3: + * Bug fix; incorrect free of compiled pattern. + * Unexpected network errors and IMAP BYE are now logged. + +- changes from version 2.7.2: + * Makefile is back to being Lua version agnostic. + +- changes from version 2.7.1: + * Makefile now builds with Lua 5.4 and PCRE2. + +- changes from version 2.7 : + * Lua 5.4 compatibility (the codebase can still be compiled with + versions 5.3, 5.2 and 5.1). + * PCRE2 compatibility (version 10.00 and later) + * New error code is returned if certificate verify fails. + * Bug fix; add missing truststore option from brief usage message. + +------------------------------------------------------------------- Old: ---- imapfilter-2.6.16.tar.gz New: ---- imapfilter-2.7.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ imapfilter.spec ++++++ --- /var/tmp/diff_new_pack.CT4lP3/_old 2020-11-17 21:25:18.077378752 +0100 +++ /var/tmp/diff_new_pack.CT4lP3/_new 2020-11-17 21:25:18.081378756 +0100 @@ -1,7 +1,7 @@ # # spec file for package imapfilter # -# Copyright (c) 2019 SUSE LLC +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: imapfilter -Version: 2.6.16 +Version: 2.7.3 Release: 0 Summary: A mail filtering utility License: MIT @@ -26,7 +26,7 @@ Source: %{name}-%{version}.tar.gz BuildRequires: lua-devel >= 5.1 BuildRequires: openssl-devel -BuildRequires: pcre-devel +BuildRequires: pcre2-devel BuildRequires: pkgconfig %description ++++++ imapfilter-2.6.16.tar.gz -> imapfilter-2.7.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.16/LICENSE new/imapfilter-2.7.3/LICENSE --- old/imapfilter-2.6.16/LICENSE 2019-11-22 23:07:11.000000000 +0100 +++ new/imapfilter-2.7.3/LICENSE 2020-11-14 19:48:19.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright (c) 2001-2019 Eleftherios Chatzimparmpas +Copyright (c) 2001-2020 Eleftherios Chatzimparmpas Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.16/NEWS new/imapfilter-2.7.3/NEWS --- old/imapfilter-2.6.16/NEWS 2019-11-22 23:07:11.000000000 +0100 +++ new/imapfilter-2.7.3/NEWS 2020-11-14 19:48:19.000000000 +0100 @@ -1,3 +1,20 @@ +IMAPFilter 2.7.3 - 14 Nov 2020 + - Bug fix; incorrect free of compiled pattern. + - Unexpected network errors and IMAP BYE are now logged. + +IMAPFilter 2.7.2 - 10 Nov 2020 + - Makefile is back to being Lua version agnostic. + +IMAPFilter 2.7.1 - 9 Nov 2020 + - Makefile now builds with Lua 5.4 and PCRE2. + +IMAPFilter 2.7 - 8 Nov 2020 + - Lua 5.4 compatibility (the codebase can still be compiled with versions + 5.3, 5.2 and 5.1). + - PCRE2 compatibility (version 10.00 and later) + - New error code is returned if certificate verify fails. + - Bug fix; add missing truststore option from brief usage message. + IMAPFilter 2.6.16 - 23 Nov 2019 - Bug fix; escape the double-quote character in passwords. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.16/README new/imapfilter-2.7.3/README --- old/imapfilter-2.6.16/README 2019-11-22 23:07:11.000000000 +0100 +++ new/imapfilter-2.7.3/README 2020-11-14 19:48:19.000000000 +0100 @@ -25,12 +25,15 @@ Installation - Compile time requirements are Lua (version 5.3 or 5.2 or 5.1), the PCRE - library, and the OpenSSL library (version 1.0.2 and later). + Compile time requirements are: + + - Lua, version 5.4 or 5.3 or 5.2 or 5.1, https://www.lua.org + - PCRE2, version 10.00 and later, https://www.pcre.org + - OpenSSL, version 1.0.2 and later, https://www.openssl.org Compile and install the program: - make all + make -j all make install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.16/src/Makefile new/imapfilter-2.7.3/src/Makefile --- old/imapfilter-2.6.16/src/Makefile 2019-11-22 23:07:11.000000000 +0100 +++ new/imapfilter-2.7.3/src/Makefile 2020-11-14 19:48:19.000000000 +0100 @@ -15,7 +15,7 @@ LIBDIRS = LIBLUA = -llua -LIBPCRE = -lpcre +LIBPCRE = -lpcre2-8 LIBSSL = -lssl LIBCRYPTO = -lcrypto diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.16/src/imapfilter.c new/imapfilter-2.7.3/src/imapfilter.c --- old/imapfilter-2.6.16/src/imapfilter.c 2019-11-22 23:07:11.000000000 +0100 +++ new/imapfilter-2.7.3/src/imapfilter.c 2020-11-14 19:48:19.000000000 +0100 @@ -246,7 +246,8 @@ { fprintf(stderr, "usage: imapfilter [-inVv] [-c configfile] " - "[-d debugfile] [-e 'command'] [-l logfile]\n"); + "[-d debugfile] [-e 'command']\n" + "\t\t [-l logfile] [-t truststore]\n"); exit(0); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.16/src/pcre.c new/imapfilter-2.7.3/src/pcre.c --- old/imapfilter-2.6.16/src/pcre.c 2019-11-22 23:07:11.000000000 +0100 +++ new/imapfilter-2.7.3/src/pcre.c 2020-11-14 19:48:19.000000000 +0100 @@ -1,22 +1,23 @@ #include <stdio.h> +#include <string.h> #include <lua.h> #include <lauxlib.h> #include <lualib.h> -#include <pcre.h> +#define PCRE2_CODE_UNIT_WIDTH 8 + +#include <pcre2.h> #include "imapfilter.h" -static int ifre_flags(lua_State *lua); static int ifre_compile(lua_State *lua); static int ifre_exec(lua_State *lua); static int ifre_free(lua_State *lua); /* Lua imapfilter library of PCRE related functions. */ static const luaL_Reg ifrelib[] = { - { "flags", ifre_flags }, { "compile", ifre_compile }, { "exec", ifre_exec }, { "free", ifre_free }, @@ -25,152 +26,40 @@ /* - * Return PCRE available compile and exec flags. - */ -static int -ifre_flags(lua_State *lua) -{ - - if (lua_gettop(lua) != 0) - luaL_error(lua, "wrong number of arguments"); - - lua_newtable(lua); - -#ifdef PCRE_CASELESS - set_table_number("CASELESS", PCRE_CASELESS); -#endif -#ifdef PCRE_MULTILINE - set_table_number("MULTILINE", PCRE_MULTILINE); -#endif -#ifdef PCRE_DOTALL - set_table_number("DOTALL", PCRE_DOTALL); -#endif -#ifdef PCRE_EXTENDED - set_table_number("EXTENDED", PCRE_EXTENDED); -#endif -#ifdef PCRE_ANCHORED - set_table_number("ANCHORED", PCRE_ANCHORED); -#endif -#ifdef PCRE_DOLLAR_ENDONLY - set_table_number("DOLLAR_ENDONLY", PCRE_DOLLAR_ENDONLY); -#endif -#ifdef PCRE_EXTRA - set_table_number("EXTRA", PCRE_EXTRA); -#endif -#ifdef PCRE_NOTBOL - set_table_number("NOTBOL", PCRE_NOTBOL); -#endif -#ifdef PCRE_NOTEOL - set_table_number("NOTEOL", PCRE_NOTEOL); -#endif -#ifdef PCRE_UNGREEDY - set_table_number("UNGREEDY", PCRE_UNGREEDY); -#endif -#ifdef PCRE_NOTEMPTY - set_table_number("NOTEMPTY", PCRE_NOTEMPTY); -#endif -#ifdef PCRE_UTF8 - set_table_number("UTF8", PCRE_UTF8); -#endif -#ifdef PCRE_NO_AUTO_CAPTURE - set_table_number("NO_AUTO_CAPTURE", PCRE_NO_AUTO_CAPTURE); -#endif -#ifdef PCRE_NO_UTF8_CHECK - set_table_number("NO_UTF8_CHECK", PCRE_NO_UTF8_CHECK); -#endif -#ifdef PCRE_FIRSTLINE - set_table_number("FIRSTLINE", PCRE_FIRSTLINE); -#endif -#ifdef PCRE_AUTO_CALLOUT - set_table_number("AUTO_CALLOUT", PCRE_AUTO_CALLOUT); -#endif -#ifdef PCRE_PARTIAL - set_table_number("PARTIAL", PCRE_PARTIAL); -#endif -#ifdef PCRE_DFA_SHORTEST - set_table_number("DFA_SHORTEST", PCRE_DFA_SHORTEST); -#endif -#ifdef PCRE_DFA_RESTART - set_table_number("DFA_RESTART", PCRE_DFA_RESTART); -#endif -#ifdef PCRE_FIRSTLINE - set_table_number("FIRSTLINE", PCRE_FIRSTLINE); -#endif -#ifdef PCRE_DUPNAMES - set_table_number("DUPNAMES", PCRE_DUPNAMES); -#endif -#ifdef PCRE_NEWLINE_CR - set_table_number("NEWLINE_CR)", PCRE_NEWLINE_CR); -#endif -#ifdef PCRE_NEWLINE_LF - set_table_number("NEWLINE_LF", PCRE_NEWLINE_LF); -#endif -#ifdef PCRE_NEWLINE_CRLF - set_table_number("NEWLINE_CRLF", PCRE_NEWLINE_CRLF); -#endif -#ifdef PCRE_NEWLINE_ANY - set_table_number("NEWLINE_ANY", PCRE_NEWLINE_ANY); -#endif -#ifdef PCRE_NEWLINE_ANYCRLF - set_table_number("NEWLINE_ANYCRLF", PCRE_NEWLINE_ANYCRLF); -#endif -#ifdef PCRE_BSR_ANYCRLF - set_table_number("PCRE_BSR_ANYCRLF", PCRE_BSR_ANYCRLF); -#endif -#ifdef PCRE_BSR_UNICODE - set_table_number("PCRE_BSR_UNICODE", PCRE_BSR_UNICODE); -#endif -#ifdef PCRE_JAVASCRIPT_COMPAT - set_table_number("PCRE_JAVASCRIPT_COMPAT", PCRE_JAVASCRIPT_COMPAT); -#endif -#ifdef PCRE_NO_START_OPTIMIZE - set_table_number("PCRE_NO_START_OPTIMIZE", PCRE_NO_START_OPTIMIZE); -#endif -#ifdef PCRE_NO_START_OPTIMISE - set_table_number("PCRE_NO_START_OPTIMISE", PCRE_NO_START_OPTIMISE); -#endif -#ifdef PCRE_PARTIAL_HARD - set_table_number("PCRE_PARTIAL_HARD", PCRE_PARTIAL_HARD); -#endif -#ifdef PCRE_NOTEMPTY_ATSTART - set_table_number("PCRE_NOTEMPTY_ATSTART", PCRE_NOTEMPTY_ATSTART); -#endif -#ifdef PCRE_UCP - set_table_number("PCRE_UCP", PCRE_UCP); -#endif - - return 1; -} - - -/* * Lua implementation of the PCRE compile function. */ static int ifre_compile(lua_State *lua) { - pcre **re; - const char *error; - int erroffset; + pcre2_code **re; + PCRE2_SPTR pattern; + int errornumber; + PCRE2_SIZE erroroffset; - if (lua_gettop(lua) != 2) + if (lua_gettop(lua) != 1) luaL_error(lua, "wrong number of arguments"); luaL_checktype(lua, 1, LUA_TSTRING); - luaL_checktype(lua, 2, LUA_TNUMBER); - re = (pcre **)(lua_newuserdata(lua, sizeof(pcre *))); + pattern = (PCRE2_SPTR)lua_tostring(lua, 1); + +#if LUA_VERSION_NUM < 504 + re = (pcre2_code **)(lua_newuserdata(lua, sizeof(pcre2_code *))); +#else + re = (pcre2_code **)(lua_newuserdatauv(lua, sizeof(pcre2_code *), 1)); +#endif - *re = pcre_compile(lua_tostring(lua, 1), lua_tonumber(lua, 2), &error, - &erroffset, NULL); + *re = pcre2_compile(pattern, PCRE2_ZERO_TERMINATED, 0, &errornumber, + &erroroffset, NULL); if (*re == NULL) { - fprintf(stderr, "RE failed at offset %d: %s\n", erroffset, - error); + PCRE2_UCHAR buffer[256]; + pcre2_get_error_message(errornumber, buffer, sizeof(buffer)); + fprintf(stderr, "RE failed at offset %d: %s\n", + (int)erroroffset, buffer); lua_pop(lua, 1); } lua_remove(lua, 1); - lua_remove(lua, 1); lua_pushboolean(lua, (*re != NULL)); lua_insert(lua, 1); @@ -185,54 +74,49 @@ static int ifre_exec(lua_State *lua) { - int i, n; - pcre *re; - int ovecsize; - int *ovector; + int i, rc; + pcre2_code *re; + pcre2_match_data *match_data; + PCRE2_SPTR subject; + size_t subject_length; + PCRE2_SIZE *ovector; - if (lua_gettop(lua) != 3) + if (lua_gettop(lua) != 2) luaL_error(lua, "wrong number of arguments"); luaL_checktype(lua, 1, LUA_TUSERDATA); luaL_checktype(lua, 2, LUA_TSTRING); - luaL_checktype(lua, 3, LUA_TNUMBER); - - re = *(pcre **)(lua_touserdata(lua, 1)); - pcre_fullinfo(re, NULL, PCRE_INFO_CAPTURECOUNT, &ovecsize); - - ovector = (int *)xmalloc(sizeof(int) * (ovecsize + 1) * 3); - - for (i = 0; i <= ovecsize; i++) - ovector[2 * i] = ovector[2 * i + 1] = -1; - - n = pcre_exec(re, NULL, lua_tostring(lua, 2), -#if LUA_VERSION_NUM < 502 - lua_objlen(lua, 2), -#else - lua_rawlen(lua, 2), -#endif - 0, lua_tonumber(lua, 3), ovector, (ovecsize + 1) * 3); - - if (n > 0) { - for (i = 1; i < n; i++) - if (ovector[2 * i] != -1 && ovector[2 * i + 1] != -1) - lua_pushlstring(lua, lua_tostring(lua, 2) + - ovector[2 * i], ovector[2 * i + 1] - - ovector[2 * i]); - else + re = *(pcre2_code **)(lua_touserdata(lua, 1)); + subject = (PCRE2_SPTR)lua_tostring(lua, 2); + subject_length = strlen((char *)subject); + + match_data = pcre2_match_data_create_from_pattern(re, NULL); + + rc = pcre2_match(re, subject, subject_length, 0, 0, match_data, NULL); + + if (rc > 0) { + ovector = pcre2_get_ovector_pointer(match_data); + for (i = 0; i < rc; i++) { + if (ovector[2 * i] != PCRE2_UNSET && + ovector[2 * i + 1] != PCRE2_UNSET) { + PCRE2_SPTR start = subject + ovector[2 * i]; + size_t len = ovector[2 * i + 1] - ovector[2 * i]; + lua_pushlstring(lua, (const char *)start, len); + } else { lua_pushnil(lua); + } + } } - xfree(ovector); + pcre2_match_data_free(match_data); lua_remove(lua, 1); lua_remove(lua, 1); - lua_remove(lua, 1); - lua_pushboolean(lua, (n > 0)); + lua_pushboolean(lua, (rc > 0)); lua_insert(lua, 1); - return (n > 0 ? n : 1); + return (rc > 0 ? rc : 1); } @@ -242,15 +126,15 @@ static int ifre_free(lua_State *lua) { - pcre *re; + pcre2_code *re; if (lua_gettop(lua) != 1) luaL_error(lua, "wrong number of arguments"); luaL_checktype(lua, 1, LUA_TUSERDATA); - re = *(pcre **)(lua_touserdata(lua, 1)); + re = *(pcre2_code **)(lua_touserdata(lua, 1)); - xfree(re); + pcre2_code_free(re); lua_remove(lua, 1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.16/src/regex.lua new/imapfilter-2.7.3/src/regex.lua --- old/imapfilter-2.6.16/src/regex.lua 2019-11-22 23:07:11.000000000 +0100 +++ new/imapfilter-2.7.3/src/regex.lua 2020-11-14 19:48:19.000000000 +0100 @@ -7,29 +7,18 @@ _regex_cache.mt.__index = function (self, key) - local zero - if _VERSION == 'Lua 5.1' then zero = '%z' else zero = '\0' end - local _, _, pattern, cflags = string.find(key, '^(.*)' .. zero .. '(.*)$') - local _, compiled = ifre.compile(pattern, tonumber(cflags)) + local r, compiled = ifre.compile(pattern) + if not r then return end self[key] = compiled return compiled end -function regex_search(pattern, subject, cflags, eflags) +function regex_search(pattern, subject) _check_required(pattern, 'string') _check_required(subject, 'string') - _check_optional(cflags, 'table') - _check_optional(eflags, 'table') - if cflags == nil then cflags = {} end - if eflags == nil then eflags = {} end - local flags = ifre.flags() - cf = 0 - for _, f in ipairs(cflags) do cf = cf + flags[f] end - ef = 0 - for _, f in pairs(eflags) do ef = cf + flags[f] end - local compiled = _regex_cache[pattern .. '\0' .. cf] + local compiled = _regex_cache[pattern] if compiled == nil then return nil end - return ifre.exec(compiled, subject, ef) + return ifre.exec(compiled, subject) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.16/src/request.c new/imapfilter-2.7.3/src/request.c --- old/imapfilter-2.6.16/src/request.c 2019-11-22 23:07:11.000000000 +0100 +++ new/imapfilter-2.7.3/src/request.c 2020-11-14 19:48:19.000000000 +0100 @@ -32,6 +32,8 @@ #define TRY(F) \ switch ((F)) { \ case -1: \ + error("unexpected network error for %s@%s\n", \ + ssn->username, ssn->server); \ if ((!strcasecmp(get_option_string("recover"), "all") || \ !strcasecmp(get_option_string("recover"), "errors"))) \ for (;;) { \ @@ -45,6 +47,8 @@ } \ return -1; \ case STATUS_BYE: \ + error("unexpected IMAP BYE for %s@%s\n", \ + ssn->username, ssn->server); \ close_connection(ssn); \ if (!strcasecmp(get_option_string("recover"), "all")) { \ if (request_login(&ssn, NULL, NULL, NULL, NULL, \ @@ -165,7 +169,7 @@ { int t, r, rg = -1, rl = -1; session *ssn = *ssnptr; - + if (*ssnptr && (*ssnptr)->socket != -1) return STATUS_PREAUTH; @@ -182,8 +186,8 @@ ssn->sslproto = ssl; } else { debug("recovering connection: %s://%s@%s:%s/%s\n", - ssn->sslproto ?"imaps" : "imap", ssn->username, ssn->server, - ssn->port, ssn->selected ? ssn->selected : ""); + ssn->sslproto ? "imaps" : "imap", ssn->username, + ssn->server, ssn->port, ssn->selected ? ssn->selected : ""); } if (open_connection(ssn) == -1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.16/src/socket.c new/imapfilter-2.7.3/src/socket.c --- old/imapfilter-2.6.16/src/socket.c 2019-11-22 23:07:11.000000000 +0100 +++ new/imapfilter-2.7.3/src/socket.c 2020-11-14 19:48:19.000000000 +0100 @@ -212,9 +212,14 @@ ssn->server, ERR_error_string(e, NULL)); goto fail; case SSL_ERROR_SSL: + e = ERR_get_error(); + if (!strcmp("certificate verify failed", + ERR_reason_error_string(e))) + fatal(ERROR_CERTIFICATE, + "initiating SSL connection to %s; %s\n", + ssn->server, ERR_error_string(e, NULL)); error("initiating SSL connection to %s; %s\n", - ssn->server, ERR_error_string(ERR_get_error(), - NULL)); + ssn->server, ERR_error_string(e, NULL)); goto fail; default: break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.16/src/system.c new/imapfilter-2.7.3/src/system.c --- old/imapfilter-2.6.16/src/system.c 2019-11-22 23:07:11.000000000 +0100 +++ new/imapfilter-2.7.3/src/system.c 2020-11-14 19:48:19.000000000 +0100 @@ -110,7 +110,11 @@ luaL_checktype(lua, 1, LUA_TSTRING); luaL_checktype(lua, 2, LUA_TSTRING); +#if LUA_VERSION_NUM < 504 fp = (FILE **) lua_newuserdata(lua, sizeof(FILE *)); +#else + fp = (FILE **) lua_newuserdatauv(lua, sizeof(FILE *), 1); +#endif *fp = NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imapfilter-2.6.16/src/version.h new/imapfilter-2.7.3/src/version.h --- old/imapfilter-2.6.16/src/version.h 2019-11-22 23:07:11.000000000 +0100 +++ new/imapfilter-2.7.3/src/version.h 2020-11-14 19:48:19.000000000 +0100 @@ -3,10 +3,10 @@ /* Program's version number. */ -#define VERSION "2.6.16" +#define VERSION "2.7.3" /* Program's copyright. */ -#define COPYRIGHT "Copyright (c) 2001-2019 Eleftherios Chatzimparmpas" +#define COPYRIGHT "Copyright (c) 2001-2020 Eleftherios Chatzimparmpas" #endif /* VERSION_H */ _______________________________________________ openSUSE Commits mailing list -- [email protected] To unsubscribe, email [email protected] List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/[email protected]
