kumquat-buildroot/package/python3/0031-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch
James Hilliard 738500c296 package/python3: bump to version 3.11.0
Add new host-pkgconf host python3 dependency.

Set new --with-build-python conf options for target python build.

Drop Fix cross compiling the uuid module patch which is no longer
required as pkgconfig is now used for include directory detection.

Refresh patches.

License hash changed due to year update:
ba00f0d93a

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-11-03 23:10:05 +01:00

43 lines
1.6 KiB
Diff

From 3edeed879871a10acbe802f4a68cff3d4869dbde Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Thu, 12 Nov 2020 00:16:18 +0100
Subject: [PATCH] lib/crypt: uClibc-ng doesn't set errno when encryption method
is not available
Since commit [1] in cpython, an exception is raised when an encryption method
is not available. This eception is handled only if errno is set to EINVAL by
crypt() but uClibc-ng doesn't set errno in crypt() [2].
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/830981961
https://gitlab.com/buildroot.org/buildroot/-/jobs/830981979
[1] https://github.com/python/cpython/commit/0d3fe8ae4961bf551e7d5e42559e2ede1a08fd7c
[2] https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libcrypt/crypt.c?h=v1.0.36#n29
Signed-off-by: Romain Naour <romain.naour@gmail.com>
[Daniel: updated for 3.10.7]
Signed-off-by: Daniel Lang <d.lang@abatec.at>
---
Lib/crypt.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Lib/crypt.py b/Lib/crypt.py
index de4a14a388..ba482487a7 100644
--- a/Lib/crypt.py
+++ b/Lib/crypt.py
@@ -98,7 +98,9 @@ def _add_method(name, *args, rounds=None):
result = crypt('', salt)
except OSError as e:
# Not all libc libraries support all encryption methods.
- if e.errno in {errno.EINVAL, errno.EPERM, errno.ENOSYS}:
+ # Not all libc libraries set errno when encryption method is not
+ # available.
+ if e.errno in {errno.EINVAL, errno.EPERM, errno.ENOSYS} or e.errno == 0:
return False
raise
if result and len(result) == method.total_size:
--
2.34.1