From: Howard Chu Date: Wed, 22 Jul 2009 04:39:57 +0000 (+0000) Subject: ITS#6214 use the main thread's context so cleanup can occur X-Git-Tag: ACLCHECK_0~409 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e08e89d6a72ee3a1c6e1fd0c30f9d1d61009d031;p=openldap ITS#6214 use the main thread's context so cleanup can occur --- diff --git a/servers/slapd/slapacl.c b/servers/slapd/slapacl.c index cc49b21525..c02d5db3b1 100644 --- a/servers/slapd/slapacl.c +++ b/servers/slapd/slapacl.c @@ -73,6 +73,7 @@ slapacl( int argc, char **argv ) char *attr = NULL; int doclose = 0; BackendDB *bd; + void *thrctx; slap_tool_init( progname, SLAPACL, argc, argv ); @@ -96,7 +97,8 @@ slapacl( int argc, char **argv ) argv = &argv[ optind ]; argc -= optind; - connection_fake_init( &conn, &opbuf, &conn ); + thrctx = ldap_pvt_thread_pool_context(); + connection_fake_init( &conn, &opbuf, thrctx ); op = &opbuf.ob_op; op->o_tmpmemctx = NULL; diff --git a/servers/slapd/slapauth.c b/servers/slapd/slapauth.c index e6a1b8916f..9b82e7db70 100644 --- a/servers/slapd/slapauth.c +++ b/servers/slapd/slapauth.c @@ -83,13 +83,15 @@ slapauth( int argc, char **argv ) Connection conn = {0}; OperationBuffer opbuf; Operation *op; + void *thrctx; slap_tool_init( progname, SLAPAUTH, argc, argv ); argv = &argv[ optind ]; argc -= optind; - connection_fake_init( &conn, &opbuf, &conn ); + thrctx = ldap_pvt_thread_pool_context(); + connection_fake_init( &conn, &opbuf, thrctx ); op = &opbuf.ob_op; conn.c_sasl_bind_mech = mech; diff --git a/servers/slapd/slapschema.c b/servers/slapd/slapschema.c index 6a00be85c7..c3b7aaed88 100644 --- a/servers/slapd/slapschema.c +++ b/servers/slapd/slapschema.c @@ -49,6 +49,7 @@ slapschema( int argc, char **argv ) Connection conn = { 0 }; OperationBuffer opbuf; Operation *op = NULL; + void *thrctx; slap_tool_init( progname, SLAPCAT, argc, argv ); @@ -78,7 +79,8 @@ slapschema( int argc, char **argv ) exit( EXIT_FAILURE ); } - connection_fake_init( &conn, &opbuf, &conn ); + thrctx = ldap_pvt_thread_pool_context(); + connection_fake_init( &conn, &opbuf, thrctx ); op = &opbuf.ob_op; op->o_tmpmemctx = NULL; op->o_bd = be;