forked from jengelh/openldap2
147 lines
4.3 KiB
Plaintext
147 lines
4.3 KiB
Plaintext
|
Index: servers/slapd/back-perl/init.c
|
||
|
===================================================================
|
||
|
--- servers/slapd/back-perl/init.c.orig
|
||
|
+++ servers/slapd/back-perl/init.c
|
||
|
@@ -35,7 +35,9 @@ perl_back_initialize(
|
||
|
BackendInfo *bi
|
||
|
)
|
||
|
{
|
||
|
- bi->bi_open = perl_back_open;
|
||
|
+ char *embedding[] = { "", "-e", "0" };
|
||
|
+
|
||
|
+ bi->bi_open = NULL;
|
||
|
bi->bi_config = 0;
|
||
|
bi->bi_close = perl_back_close;
|
||
|
bi->bi_destroy = 0;
|
||
|
@@ -63,16 +65,7 @@ perl_back_initialize(
|
||
|
bi->bi_connection_init = 0;
|
||
|
bi->bi_connection_destroy = 0;
|
||
|
|
||
|
- return 0;
|
||
|
-}
|
||
|
-
|
||
|
-int
|
||
|
-perl_back_open(
|
||
|
- BackendInfo *bi
|
||
|
-)
|
||
|
-{
|
||
|
- char *embedding[] = { "", "-e", "0" };
|
||
|
-
|
||
|
+ /* injecting code from perl_back_open, because using fonction reference (bi->bi_open) is not functional */
|
||
|
Debug( LDAP_DEBUG_TRACE, "perl backend open\n", 0, 0, 0 );
|
||
|
|
||
|
if( PERL_INTERPRETER != NULL ) {
|
||
|
Index: servers/slapd/back-perl/proto-perl.h
|
||
|
===================================================================
|
||
|
--- servers/slapd/back-perl/proto-perl.h.orig
|
||
|
+++ servers/slapd/back-perl/proto-perl.h
|
||
|
@@ -22,7 +22,6 @@ LDAP_BEGIN_DECL
|
||
|
|
||
|
extern BI_init perl_back_initialize;
|
||
|
|
||
|
-extern BI_open perl_back_open;
|
||
|
extern BI_close perl_back_close;
|
||
|
|
||
|
extern BI_db_init perl_back_db_init;
|
||
|
Index: servers/slapd/back-perl/bind.c
|
||
|
===================================================================
|
||
|
--- servers/slapd/back-perl/bind.c.orig
|
||
|
+++ servers/slapd/back-perl/bind.c
|
||
|
@@ -32,7 +32,7 @@ perl_back_bind(
|
||
|
|
||
|
PerlBackend *perl_back = (PerlBackend *) op->o_bd->be_private;
|
||
|
|
||
|
-#ifdef HAVE_WIN32_ASPERL
|
||
|
+#if defined(HAVE_WIN32_ASPERL) || defined(USE_ITHREADS)
|
||
|
PERL_SET_CONTEXT( PERL_INTERPRETER );
|
||
|
#endif
|
||
|
|
||
|
Index: servers/slapd/back-perl/add.c
|
||
|
===================================================================
|
||
|
--- servers/slapd/back-perl/add.c.orig
|
||
|
+++ servers/slapd/back-perl/add.c
|
||
|
@@ -26,6 +26,10 @@ perl_back_add(
|
||
|
int len;
|
||
|
int count;
|
||
|
|
||
|
+#if defined(HAVE_WIN32_ASPERL) || defined(USE_ITHREADS)
|
||
|
+ PERL_SET_CONTEXT( PERL_INTERPRETER );
|
||
|
+#endif
|
||
|
+
|
||
|
ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );
|
||
|
ldap_pvt_thread_mutex_lock( &entry2str_mutex );
|
||
|
|
||
|
Index: servers/slapd/back-perl/compare.c
|
||
|
===================================================================
|
||
|
--- servers/slapd/back-perl/compare.c.orig
|
||
|
+++ servers/slapd/back-perl/compare.c
|
||
|
@@ -41,6 +41,10 @@ perl_back_compare(
|
||
|
op->orc_ava->aa_desc->ad_cname.bv_val ), "=" ),
|
||
|
op->orc_ava->aa_value.bv_val );
|
||
|
|
||
|
+#if defined(HAVE_WIN32_ASPERL) || defined(USE_ITHREADS)
|
||
|
+ PERL_SET_CONTEXT( PERL_INTERPRETER );
|
||
|
+#endif
|
||
|
+
|
||
|
ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );
|
||
|
|
||
|
{
|
||
|
Index: servers/slapd/back-perl/delete.c
|
||
|
===================================================================
|
||
|
--- servers/slapd/back-perl/delete.c.orig
|
||
|
+++ servers/slapd/back-perl/delete.c
|
||
|
@@ -25,6 +25,10 @@ perl_back_delete(
|
||
|
PerlBackend *perl_back = (PerlBackend *) op->o_bd->be_private;
|
||
|
int count;
|
||
|
|
||
|
+#if defined(HAVE_WIN32_ASPERL) || defined(USE_ITHREADS)
|
||
|
+ PERL_SET_CONTEXT( PERL_INTERPRETER );
|
||
|
+#endif
|
||
|
+
|
||
|
ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );
|
||
|
|
||
|
{
|
||
|
Index: servers/slapd/back-perl/modify.c
|
||
|
===================================================================
|
||
|
--- servers/slapd/back-perl/modify.c.orig
|
||
|
+++ servers/slapd/back-perl/modify.c
|
||
|
@@ -27,7 +27,9 @@ perl_back_modify(
|
||
|
int count;
|
||
|
int i;
|
||
|
|
||
|
-
|
||
|
+#if defined(HAVE_WIN32_ASPERL) || defined(USE_ITHREADS)
|
||
|
+ PERL_SET_CONTEXT( PERL_INTERPRETER );
|
||
|
+#endif
|
||
|
ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );
|
||
|
|
||
|
{
|
||
|
Index: servers/slapd/back-perl/modrdn.c
|
||
|
===================================================================
|
||
|
--- servers/slapd/back-perl/modrdn.c.orig
|
||
|
+++ servers/slapd/back-perl/modrdn.c
|
||
|
@@ -25,6 +25,9 @@ perl_back_modrdn(
|
||
|
PerlBackend *perl_back = (PerlBackend *) op->o_bd->be_private;
|
||
|
int count;
|
||
|
|
||
|
+#if defined(HAVE_WIN32_ASPERL) || defined(USE_ITHREADS)
|
||
|
+ PERL_SET_CONTEXT( PERL_INTERPRETER );
|
||
|
+#endif
|
||
|
ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );
|
||
|
|
||
|
{
|
||
|
Index: servers/slapd/back-perl/search.c
|
||
|
===================================================================
|
||
|
--- servers/slapd/back-perl/search.c.orig
|
||
|
+++ servers/slapd/back-perl/search.c
|
||
|
@@ -34,6 +34,9 @@ perl_back_search(
|
||
|
char *buf;
|
||
|
int i;
|
||
|
|
||
|
+#if defined(HAVE_WIN32_ASPERL) || defined(USE_ITHREADS)
|
||
|
+ PERL_SET_CONTEXT( PERL_INTERPRETER );
|
||
|
+#endif
|
||
|
ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );
|
||
|
|
||
|
{
|