[PATCH 3/3] wafsamba.abi: Fix abi_match with both excludes and includes.

Jelmer Vernooij jelmer at samba.org
Mon Nov 5 11:36:30 MST 2012


This fixes a regression introduced by 9c3e294400234ebdf9b98031bae583524fd0b0ac
which caused internal symbols in libldb to be exposed.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9357
---
 buildtools/wafsamba/samba_abi.py      |  6 +++---
 buildtools/wafsamba/tests/test_abi.py | 17 +++++++++++++++++
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index 894f24f..afccd51 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -191,12 +191,12 @@ def abi_write_vscript(f, libname, current_version, versions, symmap, abi_match):
             f.write("\t\t%s;\n" % x)
     else:
         f.write("\t\t*;\n")
-    if len(local_abi) > 0:
+    if abi_match != ["*"]:
         f.write("\tlocal:\n")
         for x in local_abi:
             f.write("\t\t%s;\n" % x[1:])
-    elif abi_match != ["*"]:
-        f.write("\tlocal: *;\n")
+        if len(global_abi) > 0:
+            f.write("\t\t*;\n")
     f.write("};\n")
 
 
diff --git a/buildtools/wafsamba/tests/test_abi.py b/buildtools/wafsamba/tests/test_abi.py
index 6ba3a49..6a44db8 100644
--- a/buildtools/wafsamba/tests/test_abi.py
+++ b/buildtools/wafsamba/tests/test_abi.py
@@ -101,3 +101,20 @@ MYLIB_0.1 {
 \t\texc_*;
 };
 """)
+
+    def test_excludes_and_includes(self):
+        f = StringIO()
+        abi_write_vscript(f, "MYLIB", "1.0", [], {
+            "pub_foo": "1.0",
+            "exc_bar": "1.0",
+            "other": "1.0"
+            }, ["pub_*", "!exc_*"])
+        self.assertEquals(f.getvalue(), """\
+1.0 {
+\tglobal:
+\t\tpub_*;
+\tlocal:
+\t\texc_*;
+\t\t*;
+};
+""")
-- 
1.8.0



More information about the samba-technical mailing list