From d2f3900f680fd6df5d5050664db15a637a606fd3 Mon Sep 17 00:00:00 2001 From: Akkariiin Date: Wed, 28 Feb 2018 16:21:28 +0800 Subject: [PATCH] fix libsodium.so.23 cannot find on some strange linux environment that case by ```ctypes.util.find_library()``` have different find path from ```CDLL()``` --- shadowsocks/crypto/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shadowsocks/crypto/util.py b/shadowsocks/crypto/util.py index 679540d..12d9b7e 100644 --- a/shadowsocks/crypto/util.py +++ b/shadowsocks/crypto/util.py @@ -68,7 +68,9 @@ def find_library(possible_lib_names, search_symbol, library_name): if path: paths.append(path) - if not paths: + # always find lib on extend path that to avoid ```CDLL()``` failed on some strange linux environment + # in that case ```ctypes.util.find_library()``` have different find path from ```CDLL()``` + if True: # We may get here when find_library fails because, for example, # the user does not have sufficient privileges to access those # tools underlying find_library on linux.