From bea6252a45f142507993863482afdf07bf50fe0e Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Jul 18 2018 17:58:36 +0000 Subject: Resolves: rhbz#1601944 - Samba AD is broken with samba 4.8.3 update (and libldb) libldb-1.4.0 was not tested with samba-dc-4.8.x. This patch use fake downgrade to 1.3.4 which works well with samba-4.8 sh [~/samba]$ git branch -r --contains ldb-1.3.4 origin/v4-8-stable origin/v4-8-test sh [~/samba]$ git branch -r --contains ldb-1.4.0 origin/HEAD -> origin/master origin/master origin/v4-9-stable origin/v4-9-test It is not ideal solution but we decided to avoid introducing epoch. Upgrade patch from f27 is not a problem because libldb >= 1.3.2 works well with any version of sssd without rebuilding and samba-dc has strict requires on libldb. There are following auto-generated requires in samba-dc Requires: libldb = 1.3.2 in fc27 Requires: libldb = 1.4.0 in fc28 (libldb-1.4.0-1.fc28.1.3.4.1 would match) Requires: libldb = 1.4.1 in fc29 --- diff --git a/.gitignore b/.gitignore index 55e9276..4918f40 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,5 @@ /ldb-1.3.1.tar.gz /ldb-1.3.2.tar.gz /ldb-1.3.3.tar.gz +/ldb-1.3.4.tar.gz /ldb-1.4.0.tar.gz diff --git a/0001-ldb-Fix-memory-leak-on-module-context.patch b/0001-ldb-Fix-memory-leak-on-module-context.patch deleted file mode 100644 index 0eadfcc..0000000 --- a/0001-ldb-Fix-memory-leak-on-module-context.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 6c78935344a4f086fc209d0bd77feac0ea5894b3 Mon Sep 17 00:00:00 2001 -From: Lukas Slebodnik -Date: Sat, 21 Oct 2017 15:09:01 +0200 -Subject: [PATCH] ldb: Fix memory leak on module context - -Introduced in e8cdacc509016d9273d63faf334d9f827585c3eb ---- - lib/ldb/ldb_tdb/ldb_index.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/ldb/ldb_tdb/ldb_index.c b/lib/ldb/ldb_tdb/ldb_index.c -index c71e866037c5cccba151bcd2346460de0424fe18..1d69ab27f20e0a367c982134ff16a06b044a0c8e 100644 ---- a/lib/ldb/ldb_tdb/ldb_index.c -+++ b/lib/ldb/ldb_tdb/ldb_index.c -@@ -516,9 +516,9 @@ static int ltdb_dn_list_store_full(struct ldb_module *module, - if (list->count == 0) { - ret = ltdb_delete_noindex(module, msg); - if (ret == LDB_ERR_NO_SUCH_OBJECT) { -- talloc_free(msg); -- return LDB_SUCCESS; -+ ret = LDB_SUCCESS; - } -+ talloc_free(msg); - return ret; - } - --- -2.14.2 - diff --git a/0001-ldb-Fix-missing-NULL-terminator-in-ldb_mod_op_test-t.patch b/0001-ldb-Fix-missing-NULL-terminator-in-ldb_mod_op_test-t.patch new file mode 100644 index 0000000..ca52b99 --- /dev/null +++ b/0001-ldb-Fix-missing-NULL-terminator-in-ldb_mod_op_test-t.patch @@ -0,0 +1,36 @@ +From f8b368c9f0c2a34b6d15303a9d6facd762e1a517 Mon Sep 17 00:00:00 2001 +From: Andrew Bartlett +Date: Thu, 8 Mar 2018 14:01:50 +1300 +Subject: [PATCH] ldb: Fix missing NULL terminator in ldb_mod_op_test testsuite + +Signed-off-by: Andrew Bartlett +Reviewed-by: Gary Lockyer +--- + lib/ldb/tests/ldb_mod_op_test.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/ldb/tests/ldb_mod_op_test.c b/lib/ldb/tests/ldb_mod_op_test.c +index d024ab66e3e..59fc766e918 100644 +--- a/lib/ldb/tests/ldb_mod_op_test.c ++++ b/lib/ldb/tests/ldb_mod_op_test.c +@@ -3099,7 +3099,7 @@ static int ldb_unique_index_test_setup(void **state) + "dn: @INDEXLIST\n" + "@IDXATTR: cn\n" + "\n"; +- const char *options[] = {"modules:unique_index_test"}; ++ const char *options[] = {"modules:unique_index_test", NULL}; + + + ret = ldb_register_module(&ldb_unique_index_test_module_ops); +@@ -3201,7 +3201,7 @@ static int ldb_non_unique_index_test_setup(void **state) + "dn: @INDEXLIST\n" + "@IDXATTR: cn\n" + "\n"; +- const char *options[] = {"modules:unique_index_test"}; ++ const char *options[] = {"modules:unique_index_test", NULL}; + + + ret = ldb_register_module(&ldb_unique_index_test_module_ops); +-- +2.18.0 + diff --git a/0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch b/0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch deleted file mode 100644 index ef18d36..0000000 --- a/0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 04e74153057d34b5dbdbc03f47d7684b4d4c1093 Mon Sep 17 00:00:00 2001 -From: Lukas Slebodnik -Date: Wed, 30 May 2018 23:22:40 +0200 -Subject: [PATCH] ldb: Run at least some tests on 32 bit machines - -lmdb is supported only on 64 bit machines. But there also -unit tests which pass just with tdb on 32 bit architectures. - -Signed-off-by: Lukas Slebodnik ---- - lib/ldb/wscript | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - -diff --git a/lib/ldb/wscript b/lib/ldb/wscript -index f5cb1e0ab28dc01e5b031c7c290bed26c7007676..03279772557284d96f5b8c81ed4a8513e5c65f17 100644 ---- a/lib/ldb/wscript -+++ b/lib/ldb/wscript -@@ -518,10 +518,6 @@ def test(ctx): - env = samba_utils.LOAD_ENVIRONMENT() - ctx.env = env - -- if not env.HAVE_LMDB: -- raise Utils.WafError('make test called, but ldb was built ' -- '--without-ldb-lmdb') -- - test_prefix = "%s/st" % (Utils.g_module.blddir) - shutil.rmtree(test_prefix, ignore_errors=True) - os.makedirs(test_prefix) -@@ -537,9 +533,13 @@ def test(ctx): - tmp_dir = os.path.join(test_prefix, 'tmp') - if not os.path.exists(tmp_dir): - os.mkdir(tmp_dir) -- pyret = samba_utils.RUN_PYTHON_TESTS( -- ['tests/python/api.py', 'tests/python/index.py'], -- extra_env={'SELFTEST_PREFIX': test_prefix}) -+ -+ if env.HAVE_LMDB: -+ pyret = samba_utils.RUN_PYTHON_TESTS( -+ ['tests/python/api.py', 'tests/python/index.py'], -+ extra_env={'SELFTEST_PREFIX': test_prefix}) -+ else: -+ pyret = 0 - print("Python testsuite returned %d" % pyret) - - cmocka_ret = 0 -@@ -549,7 +549,10 @@ def test(ctx): - 'ldb_tdb_guid_mod_op_test', - 'ldb_msg_test', - 'ldb_tdb_kv_ops_test', -- 'ldb_tdb_test', -+ 'ldb_tdb_test'] -+ -+ if env.HAVE_LMDB: -+ test_exes += [ - 'ldb_mdb_mod_op_test', - 'ldb_lmdb_test', - # we don't want to run ldb_lmdb_size_test (which proves we can --- -2.17.0 - diff --git a/0002-replace-Only-warn-if-rpc-rpc.h-haven-t-been-found.patch b/0002-replace-Only-warn-if-rpc-rpc.h-haven-t-been-found.patch new file mode 100644 index 0000000..300c77b --- /dev/null +++ b/0002-replace-Only-warn-if-rpc-rpc.h-haven-t-been-found.patch @@ -0,0 +1,37 @@ +From 350826868dc81846e0b1086ad5f69506ae2a44f6 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 26 Feb 2018 14:07:28 +0100 +Subject: [PATCH] replace: Only warn if rpc/rpc.h haven't been found +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is also used by talloc, tevent, etc. Those libs don't need or use +rpc.h + +Signed-off-by: Andreas Schneider +Reviewed-by: Ralph Boehme + +Autobuild-User(master): Ralph Böhme +Autobuild-Date(master): Tue Feb 27 03:23:37 CET 2018 on sn-devel-144 +--- + lib/replace/wscript | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/lib/replace/wscript b/lib/replace/wscript +index 2c638b772124f720fa6a6ecce053296a8efdc56a..a2e2d1184777c9e89db889a81f05dce9e31d2630 100644 +--- a/lib/replace/wscript ++++ b/lib/replace/wscript +@@ -82,8 +82,7 @@ def configure(conf): + conf.CHECK_HEADERS('rpc/rpc.h rpc/nettype.h', lib='tirpc', together=True) + conf.SET_TARGET_TYPE('tirpc', 'SYSLIB') + if not conf.CONFIG_SET('HAVE_RPC_RPC_H'): +- Logs.error('ERROR: No rpc/rpc.h header found, tirpc or libntirpc missing?') +- sys.exit(1) ++ Logs.warn('No rpc/rpc.h header found, tirpc or libntirpc missing?') + + conf.SET_TARGET_TYPE('nsl', 'EMPTY') + conf.CHECK_HEADERS('rpc/rpc.h rpcsvc/yp_prot.h', lib='tirpc') +-- +2.18.0 + diff --git a/libldb.spec b/libldb.spec index f836259..a5309a2 100644 --- a/libldb.spec +++ b/libldb.spec @@ -14,20 +14,19 @@ Name: libldb Version: 1.4.0 -Release: 1%{?dist} +Release: 2%{?dist}.1.3.4 Summary: A schema-less, ldap like, API and database Requires: libtalloc%{?_isa} >= %{talloc_version} Requires: libtdb%{?_isa} >= %{tdb_version} Requires: libtevent%{?_isa} >= %{tevent_version} License: LGPLv3+ URL: http://ldb.samba.org/ -Source: http://samba.org/ftp/ldb/ldb-%{version}.tar.gz +Source: http://samba.org/ftp/ldb/ldb-1.3.4.tar.gz BuildRequires: gcc BuildRequires: libtalloc-devel >= %{talloc_version} BuildRequires: libtdb-devel >= %{tdb_version} BuildRequires: libtevent-devel >= %{tevent_version} -BuildRequires: lmdb-devel >= 0.9.16 BuildRequires: popt-devel BuildRequires: libxslt BuildRequires: docbook-style-xsl @@ -49,8 +48,8 @@ BuildRequires: python3-tevent %endif # Patches -Patch0001: 0001-ldb-Fix-memory-leak-on-module-context.patch -Patch0002: 0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch +Patch0001: 0001-ldb-Fix-missing-NULL-terminator-in-ldb_mod_op_test-t.patch +Patch0002: 0002-replace-Only-warn-if-rpc-rpc.h-haven-t-been-found.patch %description An extensible library that implements an LDAP like API to access remote LDAP @@ -135,9 +134,9 @@ Development files for the Python bindings for the LDB library %endif %prep -%setup -q -n ldb-%{version} +%setup -q -n ldb-1.3.4 %patch0001 -p3 -%patch0002 -p3 +%patch0002 -p1 %build @@ -185,11 +184,6 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_* %files %dir %{_libdir}/ldb %{_libdir}/libldb.so.* -%{_libdir}/ldb/libldb-key-value.so -# lmdb is not supported on 32 bit architectures -%if 0%{?__isa_bits} == 64 -%{_libdir}/ldb/libldb-mdb-int.so -%endif %dir %{_libdir}/ldb/modules %dir %{_libdir}/ldb/modules/ldb %{_libdir}/ldb/modules/ldb/*.so @@ -253,6 +247,9 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_* %endif %changelog +* Wed Jul 18 2018 Lukas Slebodnik - 1.4.0-2-1.3.4 +- Resolves: rhbz#1601944 - Samba AD is broken with samba 4.8.3 update (and libldb) + * Wed May 30 2018 Lukas Slebodnik - 1.4.0-1 - New upstream release 1.4.0 - Resolves: rhbz#1584450 - libldb-1.4.0 is available diff --git a/sources b/sources index 5459709..caf0be7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ldb-1.4.0.tar.gz) = 95b024b5aceac0d6360f3c98e70e1f649c53fa0e849b0f3dbb7c46cf47fac718fd13c73dd1531cefaec19d3e6b0f6751b372d1fc814dd58dd288a6cf1dc57a6c +SHA512 (ldb-1.3.4.tar.gz) = b02abbb3742711e8cce59099748ce223e0ef0fbfccbc1bc9fe161edae865ff7cc60b8a1c1c90892fa922261484a852ee2828da0f3e6fc6ecfe591c166f953e21