From b1f50df3b1cde1b8c770d810e201077aa1bec921 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Sun, 19 Aug 2018 03:55:30 -0700 Subject: [PATCH] Avoids calling ffi.dlopen(None) on Windows ffi.dlopen(None) cannot work on Windows and it is a known issue [1]. This patch avoids this call on Windows hosts. [1] https://bugs.python.org/issue23606 Change-Id: I44436146cdc402087f33f4b99054176134ec5b81 Closes-Bug: #1788025 --- oslo_privsep/capabilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oslo_privsep/capabilities.py b/oslo_privsep/capabilities.py index 4fbb20a..fc3a4ea 100644 --- a/oslo_privsep/capabilities.py +++ b/oslo_privsep/capabilities.py @@ -108,13 +108,13 @@ int prctl (int __option, ...); ''' ffi = cffi.FFI() -crt = ffi.dlopen(None) ffi.cdef(CDEF) if platform.system() == 'Linux': # mock.patching crt.* directly seems to upset cffi. Use an # indirection point here for easier testing. + crt = ffi.dlopen(None) _prctl = crt.prctl _capget = crt.capget _capset = crt.capset