Skip to content

Commit

Permalink
fix locating _xtables_libdir with glibc >= 2.32
Browse files Browse the repository at this point in the history
It appears ldconfig -v changed its output in glibc 2.32 and now looks
like this:

/lib/x86_64-linux-gnu: (from /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
	libplds4.so -> libplds4.so
	...

This breaks the regex xtables.py is using to look for the linker search
path, so I've adjusted the regex to work with the old and new formats.
  • Loading branch information
mwhudson committed May 21, 2021
1 parent 542efdb commit 18d326d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iptc/xtables.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ class xtables_target(ct.Union):
_xtables_libdir = os.getenv("XTABLES_LIBDIR")
if _xtables_libdir is None:
import re
ldconfig_path_regex = re.compile('^(/.*):$')
ldconfig_path_regex = re.compile('^(/.*):($| \\(from)')
import subprocess
ldconfig = subprocess.Popen(
('/sbin/ldconfig', '-N', '-v'),
Expand Down

0 comments on commit 18d326d

Please sign in to comment.