33 lines
945 B
Diff
33 lines
945 B
Diff
From bfcf0025b6ba264e6c0c1899d9de2bad8f39ee1a Mon Sep 17 00:00:00 2001
|
|
From: Mizunashi Mana <mizunashi-mana@noreply.git>
|
|
Date: Wed, 5 Sep 2018 20:06:31 +0900
|
|
Subject: [PATCH 09/10] 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
|
|
--
|
|
2.19.1
|
|
|