]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
py: load the SONAME-versioned shared object
authorArturo Borrero Gonzalez <arturo@netfilter.org>
Tue, 10 Dec 2019 11:00:45 +0000 (12:00 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 10 Dec 2019 18:07:16 +0000 (19:07 +0100)
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.

Reported-by: Michael Biebl <biebl@debian.org>
Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
py/nftables.py

index 48eb54fe232d4486dbe0af75affe9ca06394ed22..2a0a1e89a43fe9a67cc528d6974bac44d231ba5a 100644 (file)
@@ -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