Python: Handle find_library assignment to temp variable

This commit is contained in:
Rasmus Wriedt Larsen
2022-04-13 11:44:15 +02:00
parent 785dc1af3c
commit 6235dc5039
3 changed files with 9 additions and 6 deletions

View File

@@ -1 +1 @@
| pam_test.py:44:18:44:44 | ControlFlowNode for pam_authenticate() | This PAM authentication call may be lead to an authorization bypass. |
| pam_test.py:48:18:48:44 | ControlFlowNode for pam_authenticate() | This PAM authentication call may be lead to an authorization bypass. |

View File

@@ -18,9 +18,13 @@ class PamResponse(Structure):
class PamConv(Structure):
pass
# this is normal way to do things
libpam = CDLL(find_library("pam"))
# but we also handle assignment to temp variable
temp = find_library("pam")
libpam = CDLL(temp)
pam_start = libpam.pam_start
pam_start.restype = c_int
pam_start.argtypes = [c_char_p, c_char_p, POINTER(PamConv), POINTER(PamHandle)]