Compare commits
10 Commits
e6d22ee278
...
107b1c0ab7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
107b1c0ab7 | ||
|
|
c433a4fc14 | ||
|
|
6c2f573584 | ||
|
|
6909fd9011 | ||
|
|
bc470e29a7 | ||
|
|
64ad19dda9 | ||
|
|
e19885b68d | ||
|
|
30f89f266b | ||
|
|
c5588be90d | ||
|
|
169cf07062 |
33
CVE-2022-40023.patch
Normal file
33
CVE-2022-40023.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
diff -urN mako/lexer.py mako.new/lexer.py
|
||||||
|
--- mako/lexer.py 2021-01-15 02:28:51.000000000 +0800
|
||||||
|
+++ mako.new/lexer.py 2022-09-22 11:19:51.277358075 +0800
|
||||||
|
@@ -295,20 +295,24 @@
|
||||||
|
return self.template
|
||||||
|
|
||||||
|
def match_tag_start(self):
|
||||||
|
- match = self.match(
|
||||||
|
- r"""
|
||||||
|
+ reg = r"""
|
||||||
|
\<% # opening tag
|
||||||
|
|
||||||
|
([\w\.\:]+) # keyword
|
||||||
|
|
||||||
|
- ((?:\s+\w+|\s*=\s*|".*?"|'.*?')*) # attrname, = \
|
||||||
|
- # sign, string expression
|
||||||
|
+ ((?:\s+\w+|\s*=\s*|"[^"]*?"|'[^']*?'|\s*,\s*)*) # attrname, = \
|
||||||
|
+ # sign, string expression
|
||||||
|
+ # comma is for backwards compat
|
||||||
|
+ # identified in #366
|
||||||
|
|
||||||
|
\s* # more whitespace
|
||||||
|
|
||||||
|
(/)?> # closing
|
||||||
|
|
||||||
|
- """,
|
||||||
|
+ """
|
||||||
|
+
|
||||||
|
+ match = self.match(
|
||||||
|
+ reg,
|
||||||
|
re.I | re.S | re.X,
|
||||||
|
)
|
||||||
|
|
||||||
BIN
Mako-1.1.4.tar.gz
Normal file
BIN
Mako-1.1.4.tar.gz
Normal file
Binary file not shown.
@ -1,58 +0,0 @@
|
|||||||
From 00a1c26aa072cd17de8a185d9afbc70070d3eab6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Mike Bayer <mike_mp@zzzcomputing.com>
|
|
||||||
Date: Wed, 20 Mar 2019 11:15:47 -0400
|
|
||||||
Subject: [PATCH] Add Constant to _ast_util
|
|
||||||
|
|
||||||
---
|
|
||||||
doc/build/changelog.rst | 6 ++++++
|
|
||||||
mako/_ast_util.py | 3 +++
|
|
||||||
tox.ini | 2 +-
|
|
||||||
3 files changed, 10 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/doc/build/changelog.rst b/doc/build/changelog.rst
|
|
||||||
index 7d110f3..24c6100 100644
|
|
||||||
--- a/doc/build/changelog.rst
|
|
||||||
+++ b/doc/build/changelog.rst
|
|
||||||
@@ -8,6 +8,12 @@ Changelog
|
|
||||||
.. changelog::
|
|
||||||
:version: 1.0.6
|
|
||||||
:released: Wed Nov 9 2016
|
|
||||||
+.. changelog::
|
|
||||||
+ :tags: bug
|
|
||||||
+ :tickets: 281
|
|
||||||
+
|
|
||||||
+ Fixed an element in the AST Python generator which changed
|
|
||||||
+ for Python 3.8, causing expression generation to fail.
|
|
||||||
|
|
||||||
.. change::
|
|
||||||
:tags: feature
|
|
||||||
diff --git a/mako/_ast_util.py b/mako/_ast_util.py
|
|
||||||
index 8d19b0d..d770451 100644
|
|
||||||
--- a/mako/_ast_util.py
|
|
||||||
+++ b/mako/_ast_util.py
|
|
||||||
@@ -679,6 +679,9 @@ class SourceGenerator(NodeVisitor):
|
|
||||||
|
|
||||||
def visit_Num(self, node):
|
|
||||||
self.write(repr(node.n))
|
|
||||||
+ # newly needed in Python 3.8
|
|
||||||
+ def visit_Constant(self, node):
|
|
||||||
+ self.write(repr(node.n))
|
|
||||||
|
|
||||||
def visit_Tuple(self, node):
|
|
||||||
self.write('(')
|
|
||||||
diff --git a/tox.ini b/tox.ini
|
|
||||||
index 19016de..45d7f00 100644
|
|
||||||
--- a/tox.ini
|
|
||||||
+++ b/tox.ini
|
|
||||||
@@ -1,7 +1,7 @@
|
|
||||||
# content of: tox.ini , put in same dir as setup.py
|
|
||||||
[tox]
|
|
||||||
minversion=1.8.dev1
|
|
||||||
-envlist = py{26,27,34,35}
|
|
||||||
+envlist = py{26,27,34,35,36,37,38}
|
|
||||||
|
|
||||||
[testenv]
|
|
||||||
cov_args=--cov=mako --cov-report term --cov-report xml
|
|
||||||
--
|
|
||||||
2.23.0
|
|
||||||
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
From 724eab2bcdf020a9dd3893b372730dd19c82f036 Mon Sep 17 00:00:00 2001
|
|
||||||
From: fwx937284 <fyq%403195354>
|
|
||||||
Date: Wed, 8 Jul 2020 15:24:47 +0800
|
|
||||||
Subject: [PATCH] Use Constant.value, not Constant.n
|
|
||||||
|
|
||||||
---
|
|
||||||
mako/_ast_util.py | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/mako/_ast_util.py b/mako/_ast_util.py
|
|
||||||
index d770451..3120659 100644
|
|
||||||
--- a/mako/_ast_util.py
|
|
||||||
+++ b/mako/_ast_util.py
|
|
||||||
@@ -681,7 +681,7 @@ class SourceGenerator(NodeVisitor):
|
|
||||||
self.write(repr(node.n))
|
|
||||||
# newly needed in Python 3.8
|
|
||||||
def visit_Constant(self, node):
|
|
||||||
- self.write(repr(node.n))
|
|
||||||
+ self.write(repr(node.value))
|
|
||||||
|
|
||||||
def visit_Tuple(self, node):
|
|
||||||
self.write('(')
|
|
||||||
--
|
|
||||||
2.23.0
|
|
||||||
|
|
||||||
@ -1,18 +1,19 @@
|
|||||||
|
%bcond_with test
|
||||||
|
|
||||||
Name: python-mako
|
Name: python-mako
|
||||||
Version: 1.0.6
|
Version: 1.1.4
|
||||||
Release: 16
|
Release: 5
|
||||||
Summary: Mako template library for Python
|
Summary: Mako template library for Python
|
||||||
License: (MIT and Python) and (BSD or GPLv2)
|
License: MIT
|
||||||
Group: Development/Languages
|
Group: Development/Languages
|
||||||
URL: http://www.makotemplates.org/
|
URL: http://www.makotemplates.org/
|
||||||
Source0: https://bitbucket.org/zzzeek/mako/get/rel_%(echo %{version} | sed "s/\./_/g").tar.bz2
|
Source0: https://files.pythonhosted.org/packages/source/M/Mako/Mako-%{version}.tar.gz
|
||||||
|
Patch0:CVE-2022-40023.patch
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
Patch6000: backport-optimize-make-test.patch
|
BuildRequires: python3-devel python3-setuptools
|
||||||
Patch6001: backport-use-Constant-value.patch
|
BuildRequires: python3-markupsafe python3-mock
|
||||||
|
BuildRequires: python3-pytest
|
||||||
BuildRequires: python3-devel python3-pytest python3-setuptools
|
|
||||||
BuildRequires: python3-markupsafe python3-mock python3-nose
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Python-mako is a template library for Python. It provides a familiar, non-XML
|
Python-mako is a template library for Python. It provides a familiar, non-XML
|
||||||
@ -38,20 +39,18 @@ Requires: python3-mako = %{version}-%{release}
|
|||||||
Help file of Mako library for Python in text and HTML formats.
|
Help file of Mako library for Python in text and HTML formats.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n zzzeek-mako-8e83c7561e3c -p1
|
%autosetup -n Mako-%{version} -p0
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%{?with_python3:%py3_build}
|
%py3_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%{?with_python3:%py3_install}
|
%py3_install
|
||||||
mv %{buildroot}/%{_bindir}/mako-render %{buildroot}/%{_bindir}/python3-mako-render
|
mv %{buildroot}/%{_bindir}/mako-render %{buildroot}/%{_bindir}/python3-mako-render
|
||||||
rm -rf doc/build
|
rm -rf doc/build
|
||||||
|
|
||||||
%check
|
%check
|
||||||
rm setup.cfg
|
%{__python3} -m pytest -v
|
||||||
export LANG=en_US.UTF-8
|
|
||||||
%{__python3} setup.py test
|
|
||||||
|
|
||||||
%files -n python3-mako
|
%files -n python3-mako
|
||||||
%license LICENSE AUTHORS
|
%license LICENSE AUTHORS
|
||||||
@ -63,6 +62,27 @@ export LANG=en_US.UTF-8
|
|||||||
%doc doc
|
%doc doc
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Sep 22 2022 dillon chen <dillon.chen@gmail.com> 1.1.4-5
|
||||||
|
- CVE-2022-40023
|
||||||
|
|
||||||
|
* Wed Mar 30 2022 wangjiang <wangjiang37@h-partners.com> 1.1.4-4
|
||||||
|
- remove python-nose build required
|
||||||
|
|
||||||
|
* Wed Feb 23 2022 yuanxin <yuanxin24@h-partners.com> - 1.1.4-3
|
||||||
|
- enable %check
|
||||||
|
|
||||||
|
* Sat Nov 27 2021 shixuantong <shixuantong@huawei.com> - 1.1.4-2
|
||||||
|
- disable %check
|
||||||
|
|
||||||
|
* Thu Jul 15 2021 huangtianhua <huangtianhua@huawei.com> 1.1.4-1
|
||||||
|
- Upgrade to 1.1.4 to support OpenStack-W
|
||||||
|
|
||||||
|
* Sat Mar 13 2021 shixuantong <shixuantong@huawei.com> - 1.1.3-2
|
||||||
|
- fix failure to build locally using rpmbuild
|
||||||
|
|
||||||
|
* Tue Feb 2 2021 wangjie<wangjie294@huawei.com> - 1.1.3-1
|
||||||
|
- upgrade version to 1.1.3
|
||||||
|
|
||||||
* Tue Jan 19 2021 tianwei <tianwei12@huawei.com> - 1.0.6-16
|
* Tue Jan 19 2021 tianwei <tianwei12@huawei.com> - 1.0.6-16
|
||||||
- Type:NA
|
- Type:NA
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user