Package: nss-pam-ldapd / 0.9.10-2

0001-Fix-crash-in-chsh.ldap.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
From: Mizunashi Mana <mizunashi-mana@noreply.git>
Date: Wed, 5 Sep 2018 20:06:31 +0900
Subject: Fix crash in chsh.ldap

Specify result type of getusershell.

Closes https://github.com/arthurdejong/nss-pam-ldapd/pull/31
---
 utils/shells.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/utils/shells.py b/utils/shells.py
index dcabfaf..92dba2f 100644
--- a/utils/shells.py
+++ b/utils/shells.py
@@ -28,9 +28,11 @@ import sys
 def list_shells():
     """List the shells from /etc/shells."""
     libc = ctypes.CDLL(ctypes.util.find_library("c"))
+    getusershell = libc.getusershell
+    getusershell.restype = ctypes.c_char_p
     libc.setusershell()
     while True:
-        shell = ctypes.c_char_p(libc.getusershell()).value
+        shell = getusershell()
         if not shell:
             break
         yield shell