Merge branch 'openwrt:master' into master

This commit is contained in:
Hayzam Sherif 2023-11-04 15:58:20 +04:00 committed by GitHub
commit 1e024d76f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 1235 additions and 14 deletions

View file

@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=python-charset-normalizer
PKG_VERSION:=3.3.0
PKG_VERSION:=3.3.2
PKG_RELEASE:=1
PYPI_NAME:=charset-normalizer
PKG_HASH:=63563193aec44bce707e0c5ca64ff69fa72ed7cf34ce6e11d5127555756fd2f6
PKG_HASH:=f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE

View file

@ -2,11 +2,12 @@
[ "$1" = python3-charset-normalizer ] || exit 0
python3 - << EOF
import sys
python3 - << 'EOF'
from charset_normalizer import from_bytes
s = 'Bсеки човек има право на образование.'
byte_str = s.encode('cp1251')
result = from_bytes(byte_str).best()
sys.exit(0 if str(result) == s else 1)
assert str(result) == s
EOF

View file

@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=python-pyopenssl
PKG_VERSION:=23.2.0
PKG_VERSION:=23.3.0
PKG_RELEASE:=1
PYPI_NAME:=pyOpenSSL
PKG_HASH:=276f931f55a452e7dea69c7173e984eb2a4407ce413c918aa34b55f82f9b8bac
PKG_HASH:=6b2cba5cc46e822750ec3e5a81ee12819850b11303630d575e98108a079c2b12
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE

View file

@ -23,7 +23,7 @@ PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
CONFIGURE_ARGS += \
--with-unixodbc=$(STAGING_DIR_HOST)/bin/odbc_config \
--with-unixodbc=$(STAGING_DIR)/host/bin/odbc_config \
--with-libpq=$(STAGING_DIR)/usr
define Package/psqlodbc/Default

View file

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=privoxy
PKG_VERSION:=3.0.33
PKG_RELEASE:=4
PKG_VERSION:=3.0.34
PKG_RELEASE:=1
PKG_SOURCE:=privoxy-$(PKG_VERSION)-stable-src.tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-stable-src.tar.gz
PKG_SOURCE_URL:=@SF/ijbswa
PKG_HASH:=04b104e70dac61561b9dd110684b250fafc8c13dbe437a60fae18ddd9a881fae
PKG_BUILD_DIR:=$(BUILD_DIR)/privoxy-$(PKG_VERSION)-stable
PKG_HASH:=e6ccbca1656f4e616b4657f8514e33a70f6697e9d7294356577839322a3c5d2c
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-stable
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
@ -58,7 +58,7 @@ define Package/privoxy
URL:=http://www.privoxy.org/
USERID:=privoxy=8118:privoxy=8118
MENU:=1
DEPENDS:=+!PRIVOXY_no_pcre:libpcre +!PRIVOXY_no_pthread:libpthread +!PRIVOXY_no_zlib:zlib
DEPENDS:=+!PRIVOXY_no_pcre:libpcre2 +!PRIVOXY_no_pthread:libpthread +!PRIVOXY_no_zlib:zlib
endef
# shown in LuCI package description

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,138 @@
From 662426360b8d10202feabdcd3515d64ea8833798 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Tue, 11 Jul 2023 06:22:16 +0200
Subject: [PATCH] Add regex_matches() to reduce HAVE_PCRE2 ifdefs
---
actions.c | 12 ++----------
client-tags.c | 6 +-----
urlmatch.c | 39 ++++++++++++++++++++++++++-------------
urlmatch.h | 4 +---
4 files changed, 30 insertions(+), 31 deletions(-)
--- a/actions.c
+++ b/actions.c
@@ -828,12 +828,8 @@ int update_action_bits_for_tag(struct cl
continue;
}
-#ifdef HAVE_PCRE2
- if (pcre2_pattern_matches(b->url->pattern.tag_regex, tag))
-#else
/* and check if one of the tag patterns matches the tag, */
- if (0 == regexec(b->url->pattern.tag_regex, tag, 0, NULL, 0))
-#endif
+ if (regex_matches(b->url->pattern.tag_regex, tag))
{
/* if it does, update the action bit map, */
if (merge_current_action(csp->action, b->action))
@@ -888,11 +884,7 @@ jb_err check_negative_tag_patterns(struc
}
for (tag = csp->tags->first; NULL != tag; tag = tag->next)
{
-#ifdef HAVE_PCRE2
- if (pcre2_pattern_matches(b->url->pattern.tag_regex, tag->str))
-#else
- if (0 == regexec(b->url->pattern.tag_regex, tag->str, 0, NULL, 0))
-#endif
+ if (regex_matches(b->url->pattern.tag_regex, tag->str))
{
/*
* The pattern matches at least one tag, thus the action
--- a/client-tags.c
+++ b/client-tags.c
@@ -659,11 +659,7 @@ int client_tag_match(const struct patter
for (tag = tags->first; tag != NULL; tag = tag->next)
{
-#ifdef HAVE_PCRE2
- if (pcre2_pattern_matches(pattern->pattern.tag_regex, tag->str))
-#else
- if (0 == regexec(pattern->pattern.tag_regex, tag->str, 0, NULL, 0))
-#endif
+ if (regex_matches(pattern->pattern.tag_regex, tag->str))
{
log_error(LOG_LEVEL_TAGGING, "Client tag '%s' matches.", tag->str);
return 1;
--- a/urlmatch.c
+++ b/urlmatch.c
@@ -1160,7 +1160,7 @@ static int simplematch(const char *patte
* Returns : TRUE for yes, FALSE otherwise.
*
*********************************************************************/
-int pcre2_pattern_matches(const pcre2_code *pattern, const char *string)
+static int pcre2_pattern_matches(const pcre2_code *pattern, const char *string)
{
PCRE2_SIZE offset;
int ret;
@@ -1191,6 +1191,29 @@ int pcre2_pattern_matches(const pcre2_co
/*********************************************************************
*
+ * Function : regex_matches
+ *
+ * Description : Checks if a compiled regex pattern matches a string
+ * using either pcre2 or pcre1 code.
+ *
+ * Parameters :
+ * 1 : pattern = The compiled pattern
+ * 2 : string = The string to check
+ *
+ * Returns : TRUE for yes, FALSE otherwise.
+ *
+ *********************************************************************/
+int regex_matches(const REGEX_TYPE *pattern, const char *string)
+{
+#ifdef HAVE_PCRE2
+ return pcre2_pattern_matches(pattern, string);
+#else
+ return (0 == regexec(pattern, string, 0, NULL, 0));
+#endif
+}
+
+/*********************************************************************
+ *
* Function : simple_domaincmp
*
* Description : Domain-wise Compare fqdn's. The comparison is
@@ -1483,13 +1506,7 @@ static int host_matches(const struct htt
if (pattern->pattern.url_spec.host_regex_type == PCRE_HOST_PATTERN)
{
return ((NULL == pattern->pattern.url_spec.host_regex)
-#ifdef HAVE_PCRE2
- || pcre2_pattern_matches(pattern->pattern.url_spec.host_regex,
- http->host));
-#else
- || (0 == regexec(pattern->pattern.url_spec.host_regex,
- http->host, 0, NULL, 0)));
-#endif
+ || regex_matches(pattern->pattern.url_spec.host_regex, http->host));
}
#endif
return ((NULL == pattern->pattern.url_spec.dbuffer) || (0 == domain_match(pattern, http)));
@@ -1512,11 +1529,7 @@ static int host_matches(const struct htt
static int path_matches(const char *path, const struct pattern_spec *pattern)
{
return ((NULL == pattern->pattern.url_spec.preg)
-#ifdef HAVE_PCRE2
- || (pcre2_pattern_matches(pattern->pattern.url_spec.preg, path)));
-#else
- || (0 == regexec(pattern->pattern.url_spec.preg, path, 0, NULL, 0)));
-#endif
+ || regex_matches(pattern->pattern.url_spec.preg, path));
}
--- a/urlmatch.h
+++ b/urlmatch.h
@@ -50,9 +50,7 @@ extern int url_requires_percent_encoding
extern int url_match(const struct pattern_spec *pattern,
const struct http_request *http);
-#ifdef HAVE_PCRE2
-extern int pcre2_pattern_matches(const pcre2_code *pattern, const char *string);
-#endif
+int regex_matches(const REGEX_TYPE *pattern, const char *string);
extern jb_err create_pattern_spec(struct pattern_spec *url, char *buf);
extern void free_pattern_spec(struct pattern_spec *url);

View file

@ -0,0 +1,30 @@
From 7fb978c74a8a46bd105d9f0ced92a4be0c9647e6 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 27 Aug 2023 12:13:48 +0200
Subject: [PATCH] configure: Fix --disable-pcre2
Previously it would result in neither pcre library being detected:
checking for getnameinfo... (cached) yes
configure: WARNING: Ignoring pcre2 even if it's available
test: =: unexpected operator
Enabling support for client-specific tags.
checking for zlibVersion in -lz... (cached) yes
Enabling compression support.
test: =: unexpected operator
test: =: unexpected operator
configure: error: Detected neither pcre2 nor pcre library.
---
configure.in | 1 +
1 file changed, 1 insertion(+)
--- a/configure.in
+++ b/configure.in
@@ -872,6 +872,7 @@ if test $enableval2 = yes; then
else
AC_MSG_WARN([Ignoring pcre2 even if it's available])
try_pcre2=no
+ have_pcre2=no
fi
if test $try_pcre2 != no; then

View file

@ -0,0 +1,38 @@
From e73b93ea9ad1f3e980bd78ed3ebf65dedbb598a2 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 27 Aug 2023 12:26:02 +0200
Subject: [PATCH] pcre2 compile_pattern(): Actually pass the anchored pattern
to pcre2_compile()
Previously the un-anchoring pattern was compiled resulting
in incorrect matches.
For example requests to:
https://www.privoxy.org/user-manual/config.html
were redirected because of the default.action section:
{+redirect{http://config.privoxy.org/}}
# Sticky Actions = +redirect{http://config.privoxy.org/}
# URL = http://www.privoxy.org/config
# Redirected URL = http://www.privoxy.org/config
# Redirect Destination = http://config.privoxy.org/
.privoxy.org/config
As the path pattern is left-anchored it should not match.
---
urlmatch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/urlmatch.c
+++ b/urlmatch.c
@@ -666,7 +666,7 @@ static jb_err compile_pattern(const char
snprintf(rebuf, rebuf_size, fmt, pattern);
- *regex = pcre2_compile((const unsigned char *)pattern,
+ *regex = pcre2_compile((const unsigned char *)rebuf,
PCRE2_ZERO_TERMINATED, PCRE2_CASELESS, &errcode,
&error_offset, NULL);
if (*regex == NULL)