Package: pam-python / 1.1.0~git20220701.1d4e111-2

0002_Use-Python3-s-PyUnicode_GET_LENGTH-as-Py23_String_Si.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 2db1a82cfb1e35aa1294f539c724af79959843f4 Mon Sep 17 00:00:00 2001
From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Date: Sun, 23 Oct 2022 00:34:07 +0200
Subject: [PATCH 2/8] Use Python3's PyUnicode_GET_LENGTH as Py23_String_Size,
 not PyBytes_Size.

 This resolves a segmentation fault during pam_putenv() based
 environment variable assignments.

Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
---
 src/pam_python.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pam_python.c b/src/pam_python.c
index 825c2f8..215e64f 100644
--- a/src/pam_python.c
+++ b/src/pam_python.c
@@ -110,7 +110,7 @@ typedef int Py_ssize_t;
 #define	Py23_String_FromStringAndSize PyUnicode_FromStringAndSize
 #define	Py23_String_GET_SIZE	PyUnicode_GET_LENGTH
 #define	Py23_String_Parse_Char	"U"
-#define	Py23_String_Size	PyBytes_Size
+#define	Py23_String_Size	PyUnicode_GET_LENGTH
 #define	Py23_String_Type	PyUnicode_Type
 #define	Py23_TYPE(p)		Py_TYPE(p)
 #endif
-- 
2.30.2