pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/databases/openldap Build fix for databases/openldap-sm...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b2129b28b395
branches:  trunk
changeset: 311080:b2129b28b395
user:      manu <manu%pkgsrc.org@localhost>
date:      Tue Jul 31 12:39:52 2018 +0000

description:
Build fix for databases/openldap-smbk5pwd

>From upstream ITS #8885

Add a configure test for hdb_generate_key_set_password() prototype

contrib/slapd-modules/smbk5pwd uses hdb_generate_key_set_password() from
Heimdal, which was shortly turned from a 5 arguments function to a 7 arguments
function before the prototype change was rolled back to address API
incompatibility.

Unfortunately, the 7 arguments hdb_generate_key_set_password() made it into
released NetBSD 8.0, causing a build break in contrib/slapd-modules/smbk5pwd.

This change adds a configure test for 7 arguments prototype so that
contrib/slapd-modules/smbk5pwd build again on NetBSD 8.0, and other OS that
would include the 7 arguments hdb_generate_key_set_password().

diffstat:

 databases/openldap/distinfo              |    3 +-
 databases/openldap/patches/patch-its8885 |  157 +++++++++++++++++++++++++++++++
 2 files changed, 159 insertions(+), 1 deletions(-)

diffs (177 lines):

diff -r 25516d9e4aaf -r b2129b28b395 databases/openldap/distinfo
--- a/databases/openldap/distinfo       Tue Jul 31 12:39:34 2018 +0000
+++ b/databases/openldap/distinfo       Tue Jul 31 12:39:52 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.110 2018/04/02 13:40:44 adam Exp $
+$NetBSD: distinfo,v 1.111 2018/07/31 12:39:52 manu Exp $
 
 SHA1 (openldap-2.4.46.tgz) = a9ae2273eb9bdd70090dafe0d018a3132606bef6
 RMD160 (openldap-2.4.46.tgz) = d7038355b1c13a0b2d5104a0c75735b63e9c4148
@@ -19,5 +19,6 @@
 SHA1 (patch-da) = 75e26bd08c6e66b69192ebfbb36db974d391ec3e
 SHA1 (patch-dd) = 9c74118ff0b2232bda729c9917082fceef41dd16
 SHA1 (patch-its7595) = 941b055bb5ac1f963b9d39384d3627a32f531cf1
+SHA1 (patch-its8885) = f70666e1a44499013c93fe9bd0d8198b5bffe11c
 SHA1 (patch-libraries_libldap_os-local.c) = 7cd4f8638456fae12499de0d36d7802e47d3d688
 SHA1 (patch-libraries_libldap_tls__m.c) = 91dab1dcfa6560c30093094586ea9eabf2e977b8
diff -r 25516d9e4aaf -r b2129b28b395 databases/openldap/patches/patch-its8885
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/openldap/patches/patch-its8885  Tue Jul 31 12:39:52 2018 +0000
@@ -0,0 +1,157 @@
+$NetBSD: patch-its8885,v 1.1 2018/07/31 12:39:52 manu Exp $
+
+Add a configure test for hdb_generate_key_set_password() prototype
+
+From upstream ITS #8885
+
+contrib/slapd-modules/smbk5pwd uses hdb_generate_key_set_password() from
+Heimdal, which was shortly turned from a 5 arguments function to a 7 arguments
+function before the prototype change was rolled back to address API
+incompatibility.
+
+Unfortunately, the 7 arguments hdb_generate_key_set_password() made it into
+released NetBSD 8.0, causing a build break in contrib/slapd-modules/smbk5pwd.
+
+This change adds a configure test for 7 arguments prototype so that
+contrib/slapd-modules/smbk5pwd build again on NetBSD 8.0, and other OS that
+would include the 7 arguments hdb_generate_key_set_password().
+
+--- build/openldap.m4.orig     2018-03-22 16:44:27.000000000 +0100
++++ build/openldap.m4  2018-07-30 03:50:36.291294379 +0200
+@@ -1141,4 +1141,27 @@
+       char *__ssl_compat = "0.9.7d";
+ #endif
+       ], [ol_cv_ssl_crl_compat=yes], [ol_cv_ssl_crl_compat=no])])
+ ])
++dnl ====================================================================
++dnl check for db_generate_key_set_password prototype
++AC_DEFUN([OL_HDB_GENERATE_KEY_SET_PASSWORD],
++[AC_CACHE_CHECK([if hdb_generate_key_set_password requires 7 arguments],
++      [ol_cv_hdb_generate_key_set_password_7_args],[
++      AC_COMPILE_IFELSE([
++              AC_LANG_PROGRAM([
++                      #include "krb5/krb5.h"
++                      #include "krb5/hdb.h"
++              ],[
++                      (void)hdb_generate_key_set_password(
++                              NULL,   /* context */
++                              NULL,   /* principal */
++                              NULL,   /* password */
++                              NULL,   /* ks_tuple */
++                              0,      /* n_ks_tuple */
++                              NULL,   /* keys */
++                              0       /* num_keys */
++                      );
++              ])],
++              [ol_cv_hdb_generate_key_set_password_7_args=yes],
++              [ol_cv_hdb_generate_key_set_password_7_args=no])])
++])
+--- include/portable.hin.orig  2018-03-22 16:44:27.000000000 +0100
++++ include/portable.hin       2018-07-30 03:50:36.309332999 +0200
+@@ -399,8 +399,11 @@
+ 
+ /* Define to 1 if you have the <openssl/ssl.h> header file. */
+ #undef HAVE_OPENSSL_SSL_H
+ 
++/* Define to 1 if hdb_generate_key_set_password needs 7 arguments */
++#undef HAVE_HDB_GENERATE_KEY_SET_PASSWORD_7_ARGS
++
+ /* Define to 1 if you have the `pipe' function. */
+ #undef HAVE_PIPE
+ 
+ /* Define to 1 if you have the `poll' function. */
+--- contrib/slapd-modules/smbk5pwd/smbk5pwd.c.orig     2018-03-22 16:44:27.000000000 +0100
++++ contrib/slapd-modules/smbk5pwd/smbk5pwd.c  2018-07-30 03:50:36.307164222 +0200
+@@ -462,10 +462,15 @@
+                               "dn=\"%s\" missing krb5KeyVersionNumber\n",
+                               op->o_log_prefix, e->e_name.bv_val, 0 );
+               }
+ 
++#ifdef HAVE_HDB_GENERATE_KEY_SET_PASSWORD_7_ARGS
++              ret = hdb_generate_key_set_password(context, ent.principal,
++                      qpw->rs_new.bv_val, NULL, 0, &ent.keys.val, &nkeys);
++#else
+               ret = hdb_generate_key_set_password(context, ent.principal,
+                       qpw->rs_new.bv_val, &ent.keys.val, &nkeys);
++#endif
+               ent.keys.len = nkeys;
+               hdb_seal_keys(context, db, &ent);
+               krb5_free_principal( context, ent.principal );
+ 
+--- configure.orig     2018-03-22 16:44:27.000000000 +0100
++++ configure  2018-07-30 03:50:36.300456664 +0200
+@@ -15815,8 +15815,55 @@
+ $as_echo "#define SLAPD_LMHASH 1" >>confdefs.h
+ 
+ fi
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if hdb_generate_key_set_password requires 7 arguments" >&5
++$as_echo_n "checking if hdb_generate_key_set_password requires 7 arguments... " >&6; }
++if test "${ol_cv_hdb_generate_key_set_password_7_args+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++
++      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++
++                      #include "krb5/krb5.h"
++                      #include "krb5/hdb.h"
++
++int
++main ()
++{
++
++                      (void)hdb_generate_key_set_password(
++                              NULL,   /* context */
++                              NULL,   /* principal */
++                              NULL,   /* password */
++                              NULL,   /* ks_tuple */
++                              0,      /* n_ks_tuple */
++                              NULL,   /* keys */
++                              0       /* num_keys */
++                      );
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  ol_cv_hdb_generate_key_set_password_7_args=yes
++else
++  ol_cv_hdb_generate_key_set_password_7_args=no
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_hdb_generate_key_set_password_7_args" >&5
++$as_echo "$ol_cv_hdb_generate_key_set_password_7_args" >&6; }
++
++if test $ol_cv_hdb_generate_key_set_password_7_args = yes ; then
++
++$as_echo "#define HAVE_HDB_GENERATE_KEY_SET_PASSWORD_7_ARGS 1" >>confdefs.h
++
++fi
++
+ ol_link_threads=no
+ 
+ case $ol_with_threads in auto | yes | nt)
+ 
+--- configure.in.orig  2018-03-22 16:44:27.000000000 +0100
++++ configure.in       2018-07-30 03:54:41.886303506 +0200
+@@ -1279,8 +1279,16 @@
+       AC_DEFINE(SLAPD_LMHASH, 1, [define to support LAN Manager passwords])
+ fi
+ 
+ dnl ----------------------------------------------------------------
++dnl hdb_generate_key_set_password prototype
++OL_HDB_GENERATE_KEY_SET_PASSWORD
++if test $ol_cv_hdb_generate_key_set_password_7_args = yes ; then
++      AC_DEFINE(HAVE_HDB_GENERATE_KEY_SET_PASSWORD_7_ARGS, 1, 
++              [define if hdb_generate_key_set_password needs 7 arguments])
++fi
++
++dnl ----------------------------------------------------------------
+ dnl Threads?
+ ol_link_threads=no
+ 
+ case $ol_with_threads in auto | yes | nt)



Home | Main Index | Thread Index | Old Index