pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/databases/php-ldap Update the EXOP patch so that it bu...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4cd0dc31ff72
branches:  trunk
changeset: 610551:4cd0dc31ff72
user:      manu <manu%pkgsrc.org@localhost>
date:      Mon Oct 29 08:50:28 2012 +0000

description:
Update the EXOP patch so that it buils with PHP>=5.3

diffstat:

 databases/php-ldap/Makefile                   |     3 +-
 databases/php-ldap/files/ldap-ctrl-exop.patch |  1070 ++++++++++++------------
 2 files changed, 539 insertions(+), 534 deletions(-)

diffs (truncated from 1603 to 300 lines):

diff -r b4a47e62547e -r 4cd0dc31ff72 databases/php-ldap/Makefile
--- a/databases/php-ldap/Makefile       Mon Oct 29 08:06:03 2012 +0000
+++ b/databases/php-ldap/Makefile       Mon Oct 29 08:50:28 2012 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.17 2012/10/02 21:25:38 asau Exp $
+# $NetBSD: Makefile,v 1.18 2012/10/29 08:50:28 manu Exp $
 
 MODNAME=               ldap
+PKGREVISION=           1
 CATEGORIES+=           databases
 COMMENT=               PHP extension for LDAP database access
 
diff -r b4a47e62547e -r 4cd0dc31ff72 databases/php-ldap/files/ldap-ctrl-exop.patch
--- a/databases/php-ldap/files/ldap-ctrl-exop.patch     Mon Oct 29 08:06:03 2012 +0000
+++ b/databases/php-ldap/files/ldap-ctrl-exop.patch     Mon Oct 29 08:50:28 2012 +0000
@@ -1,7 +1,7 @@
-$NetBSD: ldap-ctrl-exop.patch,v 1.2 2009/09/13 19:45:42 manu Exp $
+$NetBSD: ldap-ctrl-exop.patch,v 1.3 2012/10/29 08:50:29 manu Exp $
 /*
  * Copyright (c) 2007-2009 Pierangelo Masarati
- * Copyright (c) 2009 Emmanuel Dreyfus
+ * Copyright (c) 2009,2012 Emmanuel Dreyfus
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -24,163 +24,46 @@
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
---- ext/ldap/ldap.c.orig       2009-06-15 15:18:48.000000000 +0000
-+++ ext/ldap/ldap.c    2009-09-05 07:10:18.000000000 +0000
-@@ -81,8 +81,35 @@
- 
- ZEND_DECLARE_MODULE_GLOBALS(ldap)
- static PHP_GINIT_FUNCTION(ldap);
- 
-+/* {{{ argXtoYofZ_force_ref - reference args helpers */
-+static
-+      ZEND_BEGIN_ARG_INFO(arg5of5_force_ref, 0)
-+              ZEND_ARG_PASS_INFO(0)
-+              ZEND_ARG_PASS_INFO(0)
-+              ZEND_ARG_PASS_INFO(0)
-+              ZEND_ARG_PASS_INFO(0)
-+              ZEND_ARG_PASS_INFO(1)
-+      ZEND_END_ARG_INFO();
-+
-+static
-+      ZEND_BEGIN_ARG_INFO(arg3to4of4_force_ref, 0)
-+              ZEND_ARG_PASS_INFO(0)
-+              ZEND_ARG_PASS_INFO(0)
-+              ZEND_ARG_PASS_INFO(1)
-+              ZEND_ARG_PASS_INFO(1)
-+      ZEND_END_ARG_INFO();
-+
-+static
-+      ZEND_BEGIN_ARG_INFO(arg4to5of5_force_ref, 0)
-+              ZEND_ARG_PASS_INFO(0)
-+              ZEND_ARG_PASS_INFO(0)
-+              ZEND_ARG_PASS_INFO(0)
-+              ZEND_ARG_PASS_INFO(1)
-+              ZEND_ARG_PASS_INFO(1)
-+      ZEND_END_ARG_INFO();
-+
- static
-       ZEND_BEGIN_ARG_INFO(arg3to6of6_force_ref, 0)
-               ZEND_ARG_PASS_INFO(0)
-               ZEND_ARG_PASS_INFO(0)
-@@ -91,8 +118,20 @@
-               ZEND_ARG_PASS_INFO(1)
-               ZEND_ARG_PASS_INFO(1)
-       ZEND_END_ARG_INFO();
- 
-+static
-+      ZEND_BEGIN_ARG_INFO(arg3to7of7_force_ref, 0)
-+              ZEND_ARG_PASS_INFO(0)
-+              ZEND_ARG_PASS_INFO(0)
-+              ZEND_ARG_PASS_INFO(1)
-+              ZEND_ARG_PASS_INFO(1)
-+              ZEND_ARG_PASS_INFO(1)
-+              ZEND_ARG_PASS_INFO(1)
-+              ZEND_ARG_PASS_INFO(1)
-+      ZEND_END_ARG_INFO();
-+/* }}} */
-+
- static int le_link, le_result, le_result_entry;
+--- ext/ldap/config.m4.orig    2012-10-25 10:15:34.000000000 +0200
++++ ext/ldap/config.m4 2012-10-25 10:15:34.000000000 +0200
+@@ -172,9 +172,11 @@
+   fi
  
- /*
-       This is just a small subset of the functionality provided by the LDAP library. All the 
-@@ -133,8 +172,22 @@
-       PHP_FE(ldap_mod_replace,                                                        NULL)
-       PHP_FE(ldap_mod_del,                                                            NULL)
- /* end gjt mod */
- 
-+/* Operations that return the result for further manipulation, Pierangelo Masarati */
-+      PHP_FE(ldap_bind_ext,                                                           NULL)
-+      PHP_FE(ldap_add_ext,                                                            NULL)
-+      PHP_FE(ldap_delete_ext,                                                         NULL)
-+      PHP_FALIAS(ldap_modify_ext,     ldap_mod_replace_ext,   NULL)
-+      PHP_FE(ldap_mod_add_ext,                                                        NULL)
-+      PHP_FE(ldap_mod_replace_ext,                                            NULL)
-+      PHP_FE(ldap_mod_del_ext,                                                        NULL)
-+      PHP_FE(ldap_compare_ext,                                                        NULL)
-+#if ando_0
-+      PHP_FE(ldap_rename_ext,                                                         NULL)
-+#endif
-+/* end of ando's mod */
-+
-       PHP_FE(ldap_errno,                                                                      NULL)
-       PHP_FE(ldap_err2str,                                                            NULL)
-       PHP_FE(ldap_error,                                                                      NULL)
-       PHP_FE(ldap_compare,                                                            NULL)
-@@ -146,16 +199,32 @@
-       PHP_FE(ldap_set_option,                                                         NULL)
-       PHP_FE(ldap_first_reference,                                            NULL)
-       PHP_FE(ldap_next_reference,                                                     NULL)
- #ifdef HAVE_LDAP_PARSE_REFERENCE
--      PHP_FE(ldap_parse_reference,    third_arg_force_ref)
-+      PHP_FE(ldap_parse_reference,            arg3to4of4_force_ref)
- #endif
- #ifdef HAVE_LDAP_PARSE_RESULT
--      PHP_FE(ldap_parse_result,                       arg3to6of6_force_ref)
-+      PHP_FE(ldap_parse_result,                       arg3to7of7_force_ref)
- #endif
-+/* LDAPv3 extended operations, Pierangelo Masarati */
-+#ifdef HAVE_LDAP_EXTENDED_OPERATION_S
-+      PHP_FE(ldap_exop,                                       arg4to5of5_force_ref)
-+      PHP_FE(ldap_exop_passwd,                        arg5of5_force_ref)
-+      PHP_FE(ldap_exop_whoami,                        second_arg_force_ref)
- #ifdef HAVE_LDAP_START_TLS_S
-       PHP_FE(ldap_start_tls,                                                          NULL)
- #endif
-+#ifdef HAVE_LDAP_REFRESH
-+      PHP_FE(ldap_refresh,
-+      NULL)
-+#endif
-+#endif
-+#ifdef HAVE_LDAP_PARSE_EXTENDED_RESULT
-+      PHP_FE(ldap_parse_exop,                         arg3to4of4_force_ref)
-+      PHP_FE(ldap_parse_exop_passwd,          third_arg_force_ref)
-+      PHP_FE(ldap_parse_exop_whoami,          third_arg_force_ref)
-+#endif
-+/* end of ando mod */
+   dnl Solaris 2.8 claims to be 2004 API, but doesn't have
+   dnl ldap_parse_reference() nor ldap_start_tls_s()
+-  AC_CHECK_FUNCS([ldap_parse_result ldap_parse_reference ldap_start_tls_s])
++  AC_CHECK_FUNCS([ldap_parse_result ldap_parse_extended_result ldap_parse_whoami ldap_parse_passwd ldap_parse_reference])
++  AC_CHECK_FUNCS([ldap_extended_operation_s ldap_start_tls_s ldap_whoami_s ldap_passwd_s])
++  AC_CHECK_FUNCS([ldap_search_ext_s ldap_add_ext_s ldap_modify_ext_s ldap_delete_ext_s ldap_compare_ext_s])
+   
+   dnl
+   dnl SASL check
+   dnl
+--- ext/ldap/ldap.c.orig       2012-10-25 10:15:34.000000000 +0200
++++ ext/ldap/ldap.c    2012-10-25 18:05:38.000000000 +0200
+@@ -66,8 +66,13 @@
+ #elif defined(HAVE_LDAP_SASL_SASL_H)
+ #include <sasl/sasl.h>
  #endif
  
++/* XXX Not detected by configure... */
++#ifdef LDAP_EXOP_REFRESH
++#define HAVE_LDAP_REFRESH 1
++#endif
++
+ typedef struct {
+       LDAP *link;
  #if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)
-       PHP_FE(ldap_set_rebind_proc,                                            NULL)
-@@ -165,8 +234,31 @@
-       PHP_FE(ldap_t61_to_8859,                                                        NULL)
-       PHP_FE(ldap_8859_to_t61,                                                        NULL)
+       zval *rebindproc;
+@@ -88,31 +93,46 @@
+ #ifdef COMPILE_DL_LDAP
+ ZEND_GET_MODULE(ldap)
  #endif
  
-+/* routines to handle standard track controls, Pierangelo Masarati */
-+#ifdef LDAP_CONTROL_MANAGEDSAIT
-+      PHP_FE(ldap_ctrl_manageDSAit,                                           NULL)
-+#endif
-+#ifdef LDAP_CONTROL_PAGEDRESULTS
-+      PHP_FE(ldap_ctrl_paged_results,         fourth_arg_force_ref)
-+      PHP_FE(ldap_ctrl_paged_results_resp,    arg3to4of4_force_ref)
-+#endif
-+#ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST
-+      PHP_FE(ldap_ctrl_ppolicy,                                                       NULL)
-+      PHP_FE(ldap_ctrl_ppolicy_resp,          arg3to6of6_force_ref)
-+#endif
-+#ifdef LDAP_CONTROL_NOOP
-+      PHP_FE(ldap_ctrl_noop,                                                          NULL)
-+#endif
-+#ifdef LDAP_CONTROL_MANAGEDIT
-+      PHP_FE(ldap_ctrl_manageDIT,                                                     NULL)
-+#endif
-+#ifdef LDAP_CONTROL_X_PERMISSIVE_MODIFY
-+      PHP_FE(ldap_ctrl_permissive_modify,                                     NULL)
-+#endif
-+/* end of ando mod */
 +
-       {NULL, NULL, NULL}
- };
- /* }}} */
- 
-@@ -193,29 +285,43 @@
- # include "zend_arg_defs.c"
- # endif
- #endif
- 
 +/* {{{ proto void _close_ldap_link()
 +   close a connection and free LDAP resources */
- static void _close_ldap_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+ static void _close_ldap_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */
  {
        ldap_linkdata *ld = (ldap_linkdata *)rsrc->ptr;
  
@@ -191,6 +74,7 @@
 +#ifdef LDAP_API_FEATURE_X_OPENLDAP
 +      ldap_unbind_ext(ld->link, NULL, NULL);
 +#ifdef HAVE_3ARG_SETREBINDPROC
++
        if (ld->rebindproc != NULL) {
                zval_dtor(ld->rebindproc);
                FREE_ZVAL(ld->rebindproc);
@@ -199,32 +83,54 @@
 +#else /* ! LDAP_API_FEATURE_X_OPENLDAP */
 +      ldap_unbind_s(ld->link);
 +#endif /* ! LDAP_API_FEATURE_X_OPENLDAP */
++
        efree(ld);
        LDAPG(num_links)--;
  }
-+/* }}} */
+ /* }}} */
  
 +/* {{{ proto void _free_ldap_result()
 +   free the result of an LDAP operation */
- static void _free_ldap_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+ static void _free_ldap_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */
  {
        LDAPMessage *result = (LDAPMessage *)rsrc->ptr;
        ldap_msgfree(result);
  }
-+/* }}} */
+ /* }}} */
  
 +/* {{{ proto void _free_ldap_result_entry()
 +   free an entry resulting from an LDAP search operation */
- static void _free_ldap_result_entry(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+ static void _free_ldap_result_entry(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */
  {
        ldap_resultentry *entry = (ldap_resultentry *)rsrc->ptr;
  
-@@ -224,8 +330,162 @@
-       }
-       zend_list_delete(entry->id);
-       efree(entry);
- } 
-+/* }}} */
+@@ -194,8 +214,21 @@
+       REGISTER_LONG_CONSTANT("GSLC_SSL_ONEWAY_AUTH", GSLC_SSL_ONEWAY_AUTH, CONST_PERSISTENT | CONST_CS);
+       REGISTER_LONG_CONSTANT("GSLC_SSL_TWOWAY_AUTH", GSLC_SSL_TWOWAY_AUTH, CONST_PERSISTENT | CONST_CS);
+ #endif
+ 
++#ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST
++      REGISTER_LONG_CONSTANT("PP_passwordExpired", PP_passwordExpired, CONST_PERSISTENT | CONST_CS);
++      REGISTER_LONG_CONSTANT("PP_accountLocked", PP_accountLocked, CONST_PERSISTENT | CONST_CS);
++      REGISTER_LONG_CONSTANT("PP_changeAfterReset", PP_changeAfterReset, CONST_PERSISTENT | CONST_CS);
++      REGISTER_LONG_CONSTANT("PP_passwordModNotAllowed", PP_passwordModNotAllowed, CONST_PERSISTENT | CONST_CS);
++      REGISTER_LONG_CONSTANT("PP_mustSupplyOldPassword", PP_mustSupplyOldPassword, CONST_PERSISTENT | CONST_CS);
++      REGISTER_LONG_CONSTANT("PP_insufficientPasswordQuality", PP_insufficientPasswordQuality, CONST_PERSISTENT | CONST_CS);
++      REGISTER_LONG_CONSTANT("PP_passwordTooShort", PP_passwordTooShort, CONST_PERSISTENT | CONST_CS);
++      REGISTER_LONG_CONSTANT("PP_passwordTooYoung", PP_passwordTooYoung, CONST_PERSISTENT | CONST_CS);
++      REGISTER_LONG_CONSTANT("PP_passwordInHistory", PP_passwordInHistory, CONST_PERSISTENT | CONST_CS);
++      REGISTER_LONG_CONSTANT("PP_noError", PP_noError, CONST_PERSISTENT | CONST_CS);
++#endif /* LDAP_CONTROL_PASSWORDPOLICYREQUEST */
++
+       le_link = zend_register_list_destructors_ex(_close_ldap_link, NULL, "ldap link", module_number);
+       le_result = zend_register_list_destructors_ex(_free_ldap_result, NULL, "ldap result", module_number);
+       le_result_entry = zend_register_list_destructors_ex(_free_ldap_result_entry, NULL, "ldap result entry", module_number);
+ 
+@@ -276,15 +309,176 @@
+       DISPLAY_INI_ENTRIES();
+ }
+ /* }}} */
+ 
 +
 +/* {{{ proto int _php_parse_referrals_resp()
 +   parse an array of LDAP referrals into a zval array */
@@ -261,6 +167,7 @@
 +      int ncontrols;
 +      char error = 0;
 +
++              
 +      if ((Z_TYPE_PP(ctrls) != IS_ARRAY) || !(ncontrols = zend_hash_num_elements(Z_ARRVAL_PP(ctrls)))) {
 +              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected non-empty array value");



Home | Main Index | Thread Index | Old Index