tdb/talloc/ldb releases

Andrew Bartlett abartlet at samba.org
Thu Jul 12 02:15:18 UTC 2018


On Thu, 2018-07-12 at 14:10 +1200, Andrew Bartlett via samba-technical
wrote:
> On Thu, 2018-07-12 at 11:16 +1200, Andrew Bartlett via samba-technical
> wrote:
> > On Thu, 2018-07-12 at 01:14 +0200, Stefan Metzmacher wrote:
> > > Am 11.07.2018 um 22:43 schrieb Andrew Bartlett via samba-technical:
> > > > On Wed, 2018-07-11 at 22:30 +0200, Stefan Metzmacher via samba-
> > > > technical wrote:
> > > > > Hi,
> > > > > 
> > > > > here're version bumps required before 4.9.0rc1.
> > > > > 
> > > > > This should go in after the tevent related patches with tevent 0.9.37.
> > > > > 
> > > > > Please review and push:-)
> > > > 
> > > > Before the ldb 1.4.1 we need to make it break Samba 4.8 (the getpid()
> > > > changes in 1.4.0 break Samba 4.8).  I tried to re-use the existing
> > > > infrastructure in ldb_module.h but couldn't make it work.
> > > > 
> > > > I'll try again today in between the other tasks but I'm clearly missing
> > > > something or not testing it right.
> > > 
> > > Something like this should do it (use just need to replace '...' with
> > > something useful.
> > > 
> > > diff --git a/lib/ldb/include/ldb_module.h b/lib/ldb/include/ldb_module.h
> > > index fd88c6218ebd..082560bbd153 100644
> > > --- a/lib/ldb/include/ldb_module.h
> > > +++ b/lib/ldb/include/ldb_module.h
> > > @@ -68,6 +68,21 @@
> > >  #error "Samba < 4.7 is not compatible with this version of ldb due to
> > > assumptions around read locks"
> > >  #endif
> > > 
> > > +/*
> > > + * Only Samba versions which expect ldb >= 1.4.0
> > > + * are compatible with ... behaviour.
> > > + *
> > > + * See https://bugzilla.samba.org/show_bug.cgi?id=....
> > > + */
> > > +#if EXPECTED_SYSTEM_LDB_VERSION_MAJOR > 1
> > > +#define __LDB_..._COMPATIBLE__ 1
> > > +#elif EXPECTED_SYSTEM_LDB_VERSION_MINOR > 3
> > > +#define __LDB_..._COMPATIBLE__ 1
> > > +#endif
> > > +#ifndef __LDB_..._COMPATIBLE__
> > > +#error "Samba < 4.9 is not compatible with this version of ldb due to
> > > assumptions around ..."
> > > +#endif
> > > +
> > >  #endif /* defined(_SAMBA_BUILD_) && defined(USING_SYSTEM_LDB) */
> > > 
> > >  struct ldb_context;
> > > 
> > 
> > Thanks.  I had guessed that much, but I'll have another go with that
> > today and fill in the dots.  Once I work that out I'll push the
> > release.
> 
> I'll include the attached (based on the above) in the that push once I
> get a review, as well as a patch to stop this happening again, but
> requiring that of ldb release X.Y.Z Samba matches the X.Y parts.  This
> will keep happening and we should catch it earlier.
> 
> Can another team member please review the enclosed?

Ahh, I swear that wasn't zero length, but anyway...

Again, attached.

Andrew Bartlett

-- 
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT   
https://catalyst.net.nz/services/samba



-------------- next part --------------
From 85354ea96b6d2eddd7a346f8dc57122e22a59ca3 Mon Sep 17 00:00:00 2001
From: Andrew Bartlett <abartlet at samba.org>
Date: Wed, 11 Jul 2018 13:41:58 +1200
Subject: [PATCH 1/2] ldb: Ban ldb 1.4.x with Samba 4.8 and earlier

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13519
Signed-off-by: Andrew Bartlett <abartlet at samba.org>
---
 lib/ldb/include/ldb_module.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/ldb/include/ldb_module.h b/lib/ldb/include/ldb_module.h
index fd88c6218eb..6ba2a49300a 100644
--- a/lib/ldb/include/ldb_module.h
+++ b/lib/ldb/include/ldb_module.h
@@ -54,18 +54,18 @@
 #endif
 
 /*
- * Only Samba versions which expect ldb >= 1.2.0
- * are compatible with read_[un]lock() behaviour.
+ * Only Samba versions which expect ldb >= 1.4.0
+ * reopen the ldb after each fork().
  *
- * See https://bugzilla.samba.org/show_bug.cgi?id=12859
+ * See https://bugzilla.samba.org/show_bug.cgi?id=13519
  */
 #if EXPECTED_SYSTEM_LDB_VERSION_MAJOR > 1
-#define __LDB_READ_LOCK_COMPATIBLE__ 1
-#elif EXPECTED_SYSTEM_LDB_VERSION_MINOR > 1
-#define __LDB_READ_LOCK_COMPATIBLE__ 1
+#define __LDB_FORK_COMPATIBLE__ 1
+#elif EXPECTED_SYSTEM_LDB_VERSION_MINOR > 3
+#define __LDB_FORK_COMPATIBLE__ 1
 #endif
-#ifndef __LDB_READ_LOCK_COMPATIBLE__
-#error "Samba < 4.7 is not compatible with this version of ldb due to assumptions around read locks"
+#ifndef __LDB_FORK_COMPATIBLE__
+#error "Samba < 4.9 is not compatible with this version of ldb due to assumptions around fork() behaviour"
 #endif
 
 #endif /* defined(_SAMBA_BUILD_) && defined(USING_SYSTEM_LDB) */
-- 
2.11.0


From d42f14d0d2fea021a9a6b8e52abd5656625cd18e Mon Sep 17 00:00:00 2001
From: Andrew Bartlett <abartlet at samba.org>
Date: Thu, 12 Jul 2018 12:34:56 +1200
Subject: [PATCH 2/2] ldb: Refuse to build Samba against a newer minor version
 of ldb

Samba is not compatible with new versions of ldb (except release versions)

Other users would not notice the breakages, but Samba makes many
more assuptions about the LDB internals than any other package.

(Specifically, LDB 1.2 and 1.4 broke builds against released
Samba versions)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13519

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
---
 lib/ldb/wscript | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/lib/ldb/wscript b/lib/ldb/wscript
index f5cb1e0ab28..eb2ccac9b39 100644
--- a/lib/ldb/wscript
+++ b/lib/ldb/wscript
@@ -69,23 +69,33 @@ def configure(conf):
     conf.env.standalone_ldb = conf.IN_LAUNCH_DIR()
 
     if not conf.env.standalone_ldb:
+        max_ldb_version = [int(x) for x in VERSION.split(".")]
+        max_ldb_version[2] = 999
+        max_ldb_version_dots = "%d.%d.%d" % tuple(max_ldb_version)
+
         if conf.env.disable_python:
-            if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb', minversion=VERSION,
-                                         onlyif='talloc tdb tevent',
-                                         implied_deps='replace talloc tdb tevent'):
+            if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb',
+                                             minversion=VERSION,
+                                             maxversion=max_ldb_version_dots,
+                                             onlyif='talloc tdb tevent',
+                                             implied_deps='replace talloc tdb tevent'):
                 conf.define('USING_SYSTEM_LDB', 1)
         else:
             using_system_pyldb_util = True
-            if not conf.CHECK_BUNDLED_SYSTEM_PKG('pyldb-util', minversion=VERSION,
-                                             onlyif='talloc tdb tevent',
-                                             implied_deps='replace talloc tdb tevent ldb'):
+            if not conf.CHECK_BUNDLED_SYSTEM_PKG('pyldb-util',
+                                                 minversion=VERSION,
+                                                 maxversion=max_ldb_version_dots,
+                                                 onlyif='talloc tdb tevent',
+                                                 implied_deps='replace talloc tdb tevent ldb'):
                 using_system_pyldb_util = False
 
             # We need to get a pyldb-util for all the python versions
             # we are building for
             if conf.env['EXTRA_PYTHON']:
                 name = 'pyldb-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG']
-                if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, minversion=VERSION,
+                if not conf.CHECK_BUNDLED_SYSTEM_PKG(name,
+                                                     minversion=VERSION,
+                                                     maxversion=max_ldb_version_dots,
                                                      onlyif='talloc tdb tevent',
                                                      implied_deps='replace talloc tdb tevent ldb'):
                     using_system_pyldb_util = False
@@ -93,9 +103,11 @@ def configure(conf):
             if using_system_pyldb_util:
                 conf.define('USING_SYSTEM_PYLDB_UTIL', 1)
 
-            if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb', minversion=VERSION,
-                                         onlyif='talloc tdb tevent pyldb-util',
-                                         implied_deps='replace talloc tdb tevent'):
+            if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb',
+                                             minversion=VERSION,
+                                             maxversion=max_ldb_version_dots,
+                                             onlyif='talloc tdb tevent pyldb-util',
+                                             implied_deps='replace talloc tdb tevent'):
                 conf.define('USING_SYSTEM_LDB', 1)
 
     if not conf.CHECK_CODE('return !(sizeof(size_t) >= 8)',
-- 
2.11.0



More information about the samba-technical mailing list