Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
501dd88433
!35 [sync] PR-33: remove some unnecessary buildrequires
From: @openeuler-sync-bot 
Reviewed-by: @compile_success 
Signed-off-by: @compile_success
2022-08-05 09:42:36 +00:00
zhouwenpei
0d0a8d78bb remove some unnecessary buildrequires
(cherry picked from commit 701c30eecde0d83d92e0a1eb1d5c4473d9440789)
2022-08-05 17:22:19 +08:00
openeuler-ci-bot
4ca88e3e7e
!30 [sync] PR-26: fix CVE-2021-46823
From: @openeuler-sync-bot 
Reviewed-by: @compile_success 
Signed-off-by: @compile_success
2022-07-27 07:08:59 +00:00
zhouwenpei
ded1906ca0 fix CVE-2021-46823
(cherry picked from commit 55cc549f6b69a3190af311ddff7abe50304acd4e)
2022-07-26 19:41:05 +08:00
openeuler-ci-bot
c0b0240f22
!24 [sync] PR-23: unknown-LDAP-result-code
From: @openeuler-sync-bot 
Reviewed-by: @shinwell_hu 
Signed-off-by: @shinwell_hu
2022-05-20 10:40:54 +00:00
xingxing
e8551f02b3 fix a system error and optimize the checking of LDAP results
(cherry picked from commit 57c34a80df7b416fb53192f9d2b0ec8ae2066413)
2022-05-19 13:56:50 +08:00
openeuler-ci-bot
faa1aa4942 !19 modify to generate debug rpms
From: @eaglegai
Reviewed-by: 
Signed-off-by:
2021-09-07 08:10:02 +00:00
eaglegai
619162bfa6 modify to generate debug file 2021-09-06 19:33:08 +08:00
openeuler-ci-bot
f815d4cde4 !11 update python-ldap to 3.3.1
From: @haochenstar
Reviewed-by: @small_leek
Signed-off-by: @small_leek
2021-02-02 16:20:41 +08:00
haochenstar
304614b64c update python-ldap to 3.3.1 2021-02-02 10:01:06 +08:00
5 changed files with 106 additions and 10 deletions

View File

@ -0,0 +1,42 @@
From d2d0d010570160b3daddd754d22f80bf5e435b6f Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Thu, 5 May 2022 10:38:57 +0800
Subject: [PATCH] fix a system error and optimize the checking of LDAP results
---
Modules/constants.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/Modules/constants.c b/Modules/constants.c
index 8b902e0..07d6065 100644
--- a/Modules/constants.c
+++ b/Modules/constants.c
@@ -31,7 +31,8 @@ static PyObject *errobjects[LDAP_ERROR_MAX - LDAP_ERROR_MIN + 1];
PyObject *
LDAPerr(int errnum)
{
- if (errnum >= LDAP_ERROR_MIN && errnum <= LDAP_ERROR_MAX) {
+ if (errnum >= LDAP_ERROR_MIN && errnum <= LDAP_ERROR_MAX &&
+ errobjects[errnum + LDAP_ERROR_OFFSET] != NULL) {
PyErr_SetNone(errobjects[errnum + LDAP_ERROR_OFFSET]);
}
else {
@@ -88,10 +89,13 @@ LDAPraise_for_message(LDAP *l, LDAPMessage *m)
ldap_get_option(l, LDAP_OPT_ERROR_STRING, &error);
}
- if (errnum >= LDAP_ERROR_MIN && errnum <= LDAP_ERROR_MAX)
+ if (errnum >= LDAP_ERROR_MIN && errnum <= LDAP_ERROR_MAX &&
+ errobjects[errnum + LDAP_ERROR_OFFSET] != NULL) {
errobj = errobjects[errnum + LDAP_ERROR_OFFSET];
- else
+ }
+ else {
errobj = LDAPexception_class;
+ }
info = PyDict_New();
if (info == NULL) {
--
2.23.0

View File

@ -0,0 +1,22 @@
From faa011b41f7141121546045925d809d54e70f5fd Mon Sep 17 00:00:00 2001
From: Kevin Backhouse <kevinbackhouse@github.com>
Date: Fri, 15 Oct 2021 15:21:37 +0100
Subject: [PATCH] Fix ReDoS in regex.
---
Lib/ldap/schema/tokenizer.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Lib/ldap/schema/tokenizer.py b/Lib/ldap/schema/tokenizer.py
index 69823f2b..623b86d5 100644
--- a/Lib/ldap/schema/tokenizer.py
+++ b/Lib/ldap/schema/tokenizer.py
@@ -13,7 +13,7 @@
r"|" # or
r"([^'$()\s]+)" # string of length >= 1 without '$() or whitespace
r"|" # or
- r"('(?:[^'\\]|\\\\|\\.)*?'(?!\w))"
+ r"('(?:[^'\\]|\\.)*'(?!\w))"
# any string or empty string surrounded by unescaped
# single quotes except if right quote is succeeded by
# alphanumeric char

Binary file not shown.

BIN
python-ldap-3.3.1.tar.gz Normal file

Binary file not shown.

View File

@ -1,14 +1,16 @@
%define debug_package %{nil}
Name: python-ldap
Version: 3.1.0
Release: 4
Name: python-ldap
Version: 3.3.1
Release: 5
Summary: An object-oriented API to access LDAP directory servers
License: Python
License: Python-2.0
URL: http://python-ldap.org/
Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
BuildRequires: gcc openldap-devel openssl-devel cyrus-sasl-devel
BuildRequires: python3-devel python3-setuptools openldap-servers
Patch0: Handle-unknown-LDAP-result-code.patch
Patch1: backport-CVE-2021-46823.patch
BuildRequires: gcc openldap-devel
BuildRequires: python3-devel python3-setuptools
%description
python-ldap provides an object-oriented API for working with LDAP within\
@ -35,11 +37,11 @@ OpenLDAP 2.x libraries, and contains modules for other LDAP-related tasks\
%package_help
%prep
%autosetup -n %{name}-%{version}
%autosetup -p1 -n %{name}-%{version}
find . -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python3}|'
sed -i 's,-Werror,-Wignore,g' tox.ini
%build
%_bindir/python3 setup.py build '--executable=%_bindir/python3 -s'
%py3_build
%install
%_bindir/python3 setup.py install -O1 --skip-build --root %buildroot
@ -56,12 +58,42 @@ sed -i 's,-Werror,-Wignore,g' tox.ini
%doc CHANGES README TODO Demo
%changelog
* Fri Aug 05 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 3.3.1-5
- Type:requirements
- Id:NA
- SUG:NA
- DESC:remove some unnecessary buildrequires
* Tue Jul 26 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 3.3.1-4
- Type:CVE
- Id:CVE-2021-46823
- SUG:NA
- DESC:fix CVE-2021-46823
* Fri May 06 2022 xingxing <xingxing9@h-partners.com> - 3.3.1-3
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:fix a system error and optimize the checking of LDAP results
* Mon Sep 06 2021 gaihuiying <gaihuiying1@huawei.com> - 3.3.1-2
- Type:requirements
- Id:NA
- SUG:NA
- DESC:modify to generate debug rpms
* Tue Feb 02 2021 xihaochen <xihaochen@huawei.com> - 3.3.1-1
- Type:requirements
- Id:NA
- SUG:NA
- DESC:update python-ldap to 3.3.1
* Wed Oct 14 2020 shixuantong<shixuantong@huawei.com> - 3.1.0-4
- delete useless buildrequires
* Tue Jun 23 2020 wangchong <wangchong56@huawei.com> - 3.1.0-3
- replace numbers with macros
* Mon Jun 22 2020 wangchong <wangchong56@huawei.com> - 3.1.0-2
- fix the build error