Skip to contentSkip to conversation

py: load the SONAME-versioned shared object

PATCH In review Arturo Borrero Gonzalez 2 participants 2 messages Dec 10, 2019 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 py: load the SONAME-versioned shared object

Instruct the python module to load the SONAME versioned shared object.

Normal end-user systems may only have available libnftables.so.1.0.0 and not libnftables.so which is usually only present in developer systems.

In Debian systems, for example:

% dpkg -L libnftables1 | grep so.1
/usr/lib/x86_64-linux-gnu/libnftables.so.1.0.0
/usr/lib/x86_64-linux-gnu/libnftables.so.1

% dpkg -L libnftables-dev | grep so
/usr/lib/x86_64-linux-gnu/libnftables.so

The "1" is not a magic number, is the SONAME of libnftables in the current version, as stated in Make_global.am.

---
 py/nftables.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
py/nftables.py +1 -1
index 48eb54fe..2a0a1e89 100644
@@ -64,7 +64,7 @@ class Nftables:
 
     validator = None
 
-    def __init__(self, sofile="libnftables.so"):
+    def __init__(self, sofile="libnftables.so.1"):
         """Instantiate a new Nftables class object.
 
         Accepts a shared object file to open, by default standard search path
reviewer Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 11 lines · Arturo Borrero Gonzalez

Instruct the python module to load the SONAME versioned shared object.

Normal end-user systems may only have available libnftables.so.1.0.0 and not libnftables.so which is usually only present in developer systems.

In Debian systems, for example:

% dpkg -L libnftables1 | grep so.1
/usr/lib/x86_64-linux-gnu/libnftables.so.1.0.0
/usr/lib/x86_64-linux-gnu/libnftables.so.1

Quoted 5 lines

% dpkg -L libnftables-dev | grep so
/usr/lib/x86_64-linux-gnu/libnftables.so

The "1" is not a magic number, is the SONAME of libnftables in the current version, as stated in Make_global.am.

My intention was to avoid the SONAME dependency, but you're right - it causes more trouble than good. Who knows, maybe nftables.py does at some point depend on a specific libntables version.

Quoted 2 lines

Feel free to push this out, Arturo.

Thanks, Phil