Relax GPGME version check
authorMathieu Parent <math.parent@gmail.com>
Fri, 24 Aug 2018 04:51:04 +0000 (06:51 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 3 Apr 2019 01:40:22 +0000 (01:40 +0000)
The current method require at least the same version as during the build. This is not needed.

Used symbols indicate the minimum is 1.2.0

Bug-Debian: http://bugs.debian.org/886333

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

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/password_hash.c

index a010d4b902644572e045fc15b790b729cf1a1fb8..e740de8fb4e7d27fea70dc428fc4e44593f57632 100644 (file)
 #ifdef ENABLE_GPGME
 #undef class
 #include <gpgme.h>
+
+/*
+ * 1.2.0 is what dpkg-shlibdeps generates, based on used symbols and
+ * libgpgme11.symbols
+ * https://salsa.debian.org/debian/gpgme/blob/debian/master/debian/libgpgme11.symbols
+ */
+
+#define MINIMUM_GPGME_VERSION "1.2.0"
 #endif
 
 /* If we have decided there is a reason to work on this request, then
@@ -4817,13 +4825,13 @@ int ldb_password_hash_module_init(const char *version)
         * if none is active already. See:
         * https://www.gnupg.org/documentation/manuals/gpgme/Signal-Handling.html#Signal-Handling
         */
-       gversion = gpgme_check_version(GPGME_VERSION);
+       gversion = gpgme_check_version(MINIMUM_GPGME_VERSION);
        if (gversion == NULL) {
                fprintf(stderr, "%s() in %s version[%s]: "
                        "gpgme_check_version(%s) not available, "
                        "gpgme_check_version(NULL) => '%s'\n",
                        __func__, __FILE__, version,
-                       GPGME_VERSION, gpgme_check_version(NULL));
+                       MINIMUM_GPGME_VERSION, gpgme_check_version(NULL));
                return LDB_ERR_UNAVAILABLE;
        }
 #endif /* ENABLE_GPGME */