Compare commits

..

No commits in common. 'c8' and 'c9' have entirely different histories.
c8 ... c9

2
.gitignore vendored

@ -1 +1 @@
SOURCES/rel_1_0_6.tar.bz2
SOURCES/rel_1_1_4.tar.gz

@ -1 +1 @@
731739475119e7e1f238407839588d4a83c08167 SOURCES/rel_1_0_6.tar.bz2
557b3318679d7675c2b1fe00bb2e744f47a53c2a SOURCES/rel_1_1_4.tar.gz

@ -1,4 +1,4 @@
From fae3baa78626f420a963abcd7426092423a2b71b Mon Sep 17 00:00:00 2001
From 0969203d36a128f42d7e4025ca29b5dfa74e1a21 Mon Sep 17 00:00:00 2001
From: Mike Bayer <mike_mp@zzzcomputing.com>
Date: Mon, 29 Aug 2022 12:28:52 -0400
Subject: [PATCH] fix tag regexp to match quoted groups correctly
@ -13,9 +13,9 @@ Fixes: #366
Change-Id: I74e0d71ff7f419970711a7cd51adcf1bb90a44c0
---
doc/build/unreleased/366.rst | 9 +++++++++
mako/lexer.py | 13 +++++++++----
mako/lexer.py | 12 ++++++++----
test/test_lexer.py | 4 ++++
3 files changed, 22 insertions(+), 4 deletions(-)
3 files changed, 21 insertions(+), 4 deletions(-)
create mode 100644 doc/build/unreleased/366.rst
diff --git a/doc/build/unreleased/366.rst b/doc/build/unreleased/366.rst
@ -35,14 +35,15 @@ index 0000000..27b0278
+ number of quotes within its quoted sections.
\ No newline at end of file
diff --git a/mako/lexer.py b/mako/lexer.py
index cf4187f..2224e77 100644
index 6226e26..c8eee6f 100644
--- a/mako/lexer.py
+++ b/mako/lexer.py
@@ -271,21 +271,26 @@ class Lexer(object):
@@ -295,20 +295,24 @@ class Lexer(object):
return self.template
def match_tag_start(self):
- match = self.match(r'''
- match = self.match(
- r"""
+ reg = r"""
\<% # opening tag
@ -58,32 +59,29 @@ index cf4187f..2224e77 100644
(/)?> # closing
- ''',
- """,
+ """
- re.I | re.S | re.X)
+
+ match = self.match(
+ reg,
+ re.I | re.S | re.X
+ )
re.I | re.S | re.X,
)
if match:
keyword, attr, isend = match.groups()
diff --git a/test/test_lexer.py b/test/test_lexer.py
index 06ebb05..bcf787e 100644
index 9807961..7d4b146 100644
--- a/test/test_lexer.py
+++ b/test/test_lexer.py
@@ -105,6 +105,10 @@ class LexerTest(TemplateTest):
self.assertRaises(exceptions.CompileException,
Lexer(template).parse)
@@ -146,6 +146,10 @@ class LexerTest(TemplateTest):
"""
self.assertRaises(exceptions.CompileException, Lexer(template).parse)
+ def test_tag_many_quotes(self):
+ template = "<%0" + '"' * 3000
+ self.assertRaises(exceptions.SyntaxException, Lexer(template).parse)
+
def test_unmatched_tag(self):
template = \
"""
template = """
<%namespace name="bar">
--
2.39.0
2.38.1

@ -1,60 +1,21 @@
%if 0%{?fedora} || 0%{?rhel} >= 8
%bcond_without python3
%else
%bcond_with python3
%endif
%if 0%{?rhel} > 7
%bcond_with beaker_tests
%bcond_with python2
%else
%bcond_without beaker_tests
%bcond_without python2
%endif
%global upname Mako
Name: python-mako
Version: 1.0.6
Release: 14%{?dist}
Version: 1.1.4
Release: 6%{?dist}
BuildArch: noarch
# Mostly MIT, but _ast_util.py is Python licensed.
# The documentation contains javascript for search licensed BSD or GPLv2
License: (MIT and Python) and (BSD or GPLv2)
Group: Development/Languages
Summary: Mako template library for Python
URL: http://www.makotemplates.org/
Source0: https://bitbucket.org/zzzeek/mako/get/rel_%(echo %{version} | sed "s/\./_/g").tar.bz2
Source0: https://github.com/sqlalchemy/mako/archive/rel_%(echo %{version} | sed "s/\./_/g").tar.gz
# https://bugzilla.redhat.com/show_bug.cgi?id=2133606
Patch0: python-mako-1.0.6-CVE-2022-40023.patch
%if %{with python2}
BuildRequires: python2-devel
BuildRequires: python2-pytest
BuildRequires: python2-setuptools
BuildRequires: python2-markupsafe
BuildRequires: python2-nose
BuildRequires: python2-mock
%if %{with beaker_tests}
BuildRequires: python2-beaker
%endif
%endif #{with python2}
%if %{with python3}
Patch0: python-mako-1.1.14-CVE-2022-40023.patch
BuildRequires: python3-devel
BuildRequires: python3-pytest
BuildRequires: python3-setuptools
BuildRequires: python3-markupsafe
BuildRequires: python3-mock
BuildRequires: python3-nose
%if %{with beaker_tests}
BuildRequires: python3-beaker
%endif
%endif #{with python3}
%global _description\
Mako is a template library written in Python. It provides a familiar, non-XML\
@ -68,299 +29,156 @@ calling and scoping semantics.
%description %_description
%if %{with python2}
%package -n python2-mako
Summary: %summary
Requires: python2-markupsafe
# Beaker is the preferred caching backend, but is not strictly necessary
Recommends: python2-beaker
%package -n python3-mako
Summary: %{summary}
%{?python_provide:%python_provide python2-mako}
# Beaker is the preferred caching backend, but is not strictly necessary
Recommends: python3-beaker
%description -n python2-mako %_description
%endif #{with python2}
Obsoletes: python2-mako < 1.1.0-3
%package doc
Summary: Documentation for the Mako template library for Python
Group: Documentation
License: (MIT and Python) and (BSD or GPLv2)
%if %{with python3}
Requires: python3-mako = %{version}-%{release}
%else
Requires: python2-mako = %{version}-%{release}
%endif #{with python3}
%description doc
Mako is a template library written in Python. It provides a familiar, non-XML
syntax which compiles into Python modules for maximum performance. Mako's
syntax and API borrows from the best ideas of many others, including Django
templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded
Python (i.e. Python Server Page) language, which refines the familiar ideas of
componentized layout and inheritance to produce one of the most straightforward
and flexible models available, while also maintaining close ties to Python
calling and scoping semantics.
%{?python_provide:%python_provide python3-mako}
This package contains documentation in text and HTML formats.
%description -n python3-mako %_description
This package contains the mako module built for use with python3.
%if %{with python3}
%package -n python3-mako
Summary: Mako template library for Python 3
Group: Development/Languages
Requires: python3-markupsafe
# Beaker is the preferred caching backend, but is not strictly necessary
Recommends: python3-beaker
%package doc
Summary: Documentation for the Mako template library for Python
Suggests: python3-mako = %{version}-%{release}
%{?python_provide:%python_provide python3-mako}
%description doc %_description
%if %{without python2}
Obsoletes: python2-mako < %{version}-%{release}
%endif #{without python2}
%description -n python3-mako
Mako is a template library written in Python. It provides a familiar, non-XML
syntax which compiles into Python modules for maximum performance. Mako's
syntax and API borrows from the best ideas of many others, including Django
templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded
Python (i.e. Python Server Page) language, which refines the familiar ideas of
componentized layout and inheritance to produce one of the most straightforward
and flexible models available, while also maintaining close ties to Python
calling and scoping semantics.
This package contains documentation in text and HTML formats.
This package contains the mako module built for use with python3.
%endif #{with python3}
%prep
%autosetup -p1 -n zzzeek-mako-8e83c7561e3c
%autosetup -p1 -n mako-rel_%(echo %{version} | sed "s/\./_/g")
%build
export RHEL_ALLOW_PYTHON2_FOR_BUILD=1
%{?with_python2:%py2_build}
%{?with_python3:%py3_build}
%py3_build
%install
%{?with_python3:%py3_install}
%if %{with python2}
export RHEL_ALLOW_PYTHON2_FOR_BUILD=1
mv %{buildroot}/%{_bindir}/mako-render %{buildroot}/%{_bindir}/python3-mako-render
%endif
%py3_install
%{?with_python2:%py2_install}
mv %{buildroot}/%{_bindir}/mako-render %{buildroot}/%{_bindir}/mako-render-%{python3_version}
ln -s ./mako-render-%{python3_version} %{buildroot}/%{_bindir}/mako-render-3
ln -s ./mako-render-%{python3_version} %{buildroot}/%{_bindir}/mako-render
# These are supporting files for building the docs. No need to ship
rm -rf doc/build
%check
%if %{with python2}
export RHEL_ALLOW_PYTHON2_FOR_BUILD=1
%{__python2} setup.py test
%endif #{with python2}
pytest-3
%if %{with python3}
%{__python3} setup.py test
%endif
%if %{with python2}
%files -n python2-mako
%license LICENSE
%doc CHANGES README.rst examples
%{_bindir}/mako-render
%{python2_sitelib}/*
%endif %{with python2}
%if %{with python3}
%files -n python3-mako
%license LICENSE
%doc CHANGES README.rst examples
%if %{with python2}
%{_bindir}/python3-mako-render
%else
%{_bindir}/mako-render
%endif
%{python3_sitelib}/*
%endif
%{_bindir}/mako-render-3
%{_bindir}/mako-render-%{python3_version}
%{python3_sitelib}/mako/
%{python3_sitelib}/Mako-*.egg-info/
%files doc
%doc doc
%changelog
* Thu Nov 17 2022 David King <amigadave@amigadave.com> - 1.0.6-14
- Fix CVE-2022-40023 (#2128977)
* Wed Jul 11 2018 Petr Viktorin <pviktori@redhat.com> - 1.0.6-13
- Disable the Python 2 subpackage again
https://bugzilla.redhat.com/show_bug.cgi?id=1590397
- Fix the Python2 workaround
* Mon Jun 25 2018 Petr Viktorin <pviktori@redhat.com> - 1.0.6-12
- Allow Python 2 for build
see https://hurl.corp.redhat.com/rhel8-py2
* Mon Jun 18 2018 Petr Viktorin <pviktori@redhat.com> - 1.0.6-11
- Add back the Python 2 subpackage (temporarily, for mesa build)
https://bugzilla.redhat.com/show_bug.cgi?id=1569193
* Mon Apr 16 2018 Petr Viktorin <pviktori@redhat.com> - 1.0.6-10
- Remove python-beaker as a build dependency
* Wed Mar 28 2018 Petr Viktorin <pviktori@redhat.com> - 1.0.6-9
- Make python-beaker an optional dependency
- Add missing python_provide for python3-mako
- Conditionalize the Python 2 subpackage
- Modernize the specfile
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.0.6-8
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Wed Sep 27 2017 Troy Dawson <tdawson@redhat.com> - 1.0.6-6
- Cleanup spec file conditionals
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.0.6-5
- Python 2 binary package renamed to python2-mako
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.0.6-2
- Rebuild for Python 3.6
* Sat Dec 17 2016 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.0.6-1
- Update to 1.0.6 (#1257376).
- Mark LICENSE as the license.
- Drop declaration of BuildRoot.
- Drop use of 2to3 since upstream supports Python 3 now.
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.3-3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Nov 12 2015 Kevin Fenzi <kevin@scrye.com> - 1.0.3-1
- Update to 1.0.3
* Thu Nov 17 2022 David King <amigadave@amigadave.com> - 1.1.4-6
- Fix CVE-2022-40023 (#2133606)
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.1.4-5
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.1.4-4
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 28 2015 Matej Cepl <mcepl@redhat.com> - 1.0.1-1
- Update to 1.0.1 (#1185339)
* Mon Mar 29 2021 David King <amigadave@amigadave.com> - 1.1.4-3
- Remove unnecessary python3-mock BuildRequires
* Wed Jun 18 2014 Luke Macken <lmacken@redhat.com> - 1.0.0-1
- Update to 1.0.0 (#1106453)
- Add a BR on python-mock
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Thu Jan 14 19:55:31 CET 2021 Petr Viktorin <pviktori@redhat.com> - 1.1.4-1
- Update to version 1.1.4
- Avoids test warnings on Python 3.10
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1907474
* Tue May 27 2014 Kalev Lember <kalevlember@gmail.com> - 0.9.1-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
* Fri Jun 26 2020 Charalampos Stratakis <cstratak@redhat.com> - 1.1.3-1
- Update to 1.1.3 (#1808872)
* Mon May 19 2014 Luke Macken <lmacken@redhat.com> - 0.9.1-2
- Create a subpackage for the documentation (#1006259)
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 1.1.1-2
- Rebuilt for Python 3.9
* Mon May 19 2014 Luke Macken <lmacken@redhat.com> - 0.9.1-1
- Update to 0.9.1 (#967837)
* Mon Feb 10 2020 Miro Hrončok <mhroncok@redhat.com> - 1.1.1-1
- Update to 1.1.1 (#1787962) (#1793184)
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Apr 9 2013 Luke Macken <lmacken@redhat.com> - 0.7.3-1
- Update to 0.7.3 (#784257)
* Tue Jan 07 2020 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.1.0-4
- Fix FTBFS with pytest-5 by dropping a BR on python-nose (mako does not use nose).
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Fri Nov 15 2019 Miro Hrončok <mhroncok@redhat.com> - 1.1.0-3
- Subpackage python2-mako has been removed
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 0.5.0-5
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
* Fri Oct 11 2019 Miro Hrončok <mhroncok@redhat.com> - 1.1.0-2
- Rename the Python-versioned executables not to start with "python"
- Make mako-render Python 3 on Fedora 32+
* Fri Aug 3 2012 David Malcolm <dmalcolm@redhat.com> - 0.5.0-4
- remove rhel logic from with_python3 conditional
* Tue Sep 03 2019 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.1.0-1
- Update to 1.1.0 (#1725969).
- https://docs.makotemplates.org/en/latest/changelog.html#change-1.1.0
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Sun Aug 18 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.12-4
- Rebuilt for Python 3.8
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.12-3
- Rebuilt for Python 3.8
* Tue Dec 13 2011 Luke Macken <lmacken@redhat.com> - 0.5.0-1
- Update to 0.5.0
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Sep 5 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.4.2-2
- Require beaker to run unittests since its required at runtime
- Fix license tag
* Wed Jun 05 2019 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.0.12-1
- Update to 1.0.12 (#1708706).
- https://docs.makotemplates.org/en/latest/changelog.html#change-1.0.12
* Mon Sep 5 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.4.2-1
- Update to 0.4.2
- Run unit tests on python3
* Wed Apr 17 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.9-1
- Update to 1.0.9 (#1698191, #1700055)
* Thu Feb 24 2011 Luke Macken <lmacken@redhat.com> - 0.4.0-1
- Update to 0.4.0 (#654779)
* Wed Mar 20 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.8-1
- Update to 1.0.8 (#1470902, #1690902)
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Wed Mar 20 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.7-1
- Update to 1.0.7 (#1470902)
* Wed Feb 02 2011 Luke Macken <lmacken@redhat.com> - 0.3.6-1
- Update to 0.3.6
- Remove 2to3 patch
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.6-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Oct 27 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.3.5-2
- Use a patch from Debian submitted upstream to convert to python3 syntax
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.6-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Oct 21 2010 Luke Macken <lmacken@redhat.com> - 0.3.5-1
- Update to 0.3.5 (#645063)
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 1.0.6-10
- Rebuilt for Python 3.7
* Wed Aug 25 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.3.4-3
- rebuild with python3.2
http://lists.fedoraproject.org/pipermail/devel/2010-August/141368.html
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.3.4-2
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
* Sun Jun 27 2010 Kyle VanderBeek <kylev@kylev.com> - 0.3.4-1
- Update to 0.3.4 security fix release
- Fix missing python3-beaker dependency
* Sat Jun 5 2010 Kyle VanderBeek <kylev@kylev.com> - 0.3.3-1
- Update to upstream 0.3.3
* Tue May 4 2010 David Malcolm <dmalcolm@redhat.com> - 0.3.2-2
- add python3 subpackage
* Tue May 04 2010 Luke Macken <lmacken@redhat.com> - 0.3.2-1
- Update to 0.3.2
- Run the test suite in %%check
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Tue Jan 06 2009 Luke Macken <lmacken@redhat.com> - 0.2.4-1
- Update to 0.2.4
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.1.10-3
- Rebuild for Python 2.6
* Wed Mar 28 2018 Petr Viktorin <pviktori@redhat.com> - 1.0.6-9
- Make python-beaker an optional dependency
- Add missing python_provide for python3-mako
- Conditionalize the Python 2 subpackage
- Modernize the specfile
* Sun May 11 2008 Kyle VanderBeek <kylev@kylev.com> - 0.1.10-2
- Fix rpmlint warnings.
- Add docs and examples.
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.0.6-8
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Wed Apr 9 2008 Kyle VanderBeek <kylev@kylev.com> - 0.1.10-1
- Initial version.
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

Loading…
Cancel
Save