Commit cbcb0cc8 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#6647

parent d18912a7
......@@ -56,6 +56,7 @@ OpenLDAP 2.4.24 Engineering
Fixed slapo-rwm double free (ITS#6720)
Fixed slapo-rwm crasher (ITS#6632)
Fixed slapo-sssvlv initialization (ITS#6649)
Fixed slapo-sssvlv to not advertise when unused (ITS#6647)
Fixed slapo-syncprov to send error if consumer is newer (ITS#6606)
Fixed slapo-syncprov filter race condition (ITS#6708)
Fixed slapo-syncprov active mod race (ITS#6709)
......
......@@ -1158,6 +1158,38 @@ static int sssvlv_db_init(
{
slap_overinst *on = (slap_overinst *)be->bd_info;
sssvlv_info *si;
if ( ov_count == 0 ) {
int rc;
rc = register_supported_control2( LDAP_CONTROL_SORTREQUEST,
SLAP_CTRL_SEARCH,
NULL,
sss_parseCtrl,
1 /* replace */,
&sss_cid );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY, "Failed to register Sort Request control '%s' (%d)\n",
LDAP_CONTROL_SORTREQUEST, rc, 0 );
return rc;
}
rc = register_supported_control2( LDAP_CONTROL_VLVREQUEST,
SLAP_CTRL_SEARCH,
NULL,
vlv_parseCtrl,
1 /* replace */,
&vlv_cid );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY, "Failed to register VLV Request control '%s' (%d)\n",
LDAP_CONTROL_VLVREQUEST, rc, 0 );
#ifdef SLAP_CONFIG_DELETE
overlay_unregister_control( be, LDAP_CONTROL_SORTREQUEST );
#endif /* SLAP_CONFIG_DELETE */
unregister_supported_control( LDAP_CONTROL_SORTREQUEST );
return rc;
}
}
si = (sssvlv_info *)ch_malloc(sizeof(sssvlv_info));
on->on_bi.bi_private = si;
......@@ -1190,6 +1222,10 @@ static int sssvlv_db_destroy(
ch_free(sort_conns);
ldap_pvt_thread_mutex_destroy( &sort_conns_mutex );
}
if ( ov_count == 0 ) {
unregister_supported_control( LDAP_CONTROL_SORTREQUEST );
}
if ( si ) {
ch_free( si );
......@@ -1217,30 +1253,9 @@ int sssvlv_initialize()
if ( rc )
return rc;
rc = register_supported_control2( LDAP_CONTROL_SORTREQUEST,
SLAP_CTRL_SEARCH,
NULL,
sss_parseCtrl,
1 /* replace */,
&sss_cid );
if ( rc == LDAP_SUCCESS ) {
rc = register_supported_control2( LDAP_CONTROL_VLVREQUEST,
SLAP_CTRL_SEARCH,
NULL,
vlv_parseCtrl,
1 /* replace */,
&vlv_cid );
}
if ( rc == LDAP_SUCCESS ) {
rc = overlay_register( &sssvlv );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY, "Failed to register server side sort overlay\n", 0, 0, 0 );
}
}
else {
Debug( LDAP_DEBUG_ANY, "Failed to register control %d\n", rc, 0, 0 );
rc = overlay_register( &sssvlv );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY, "Failed to register server side sort overlay\n", 0, 0, 0 );
}
return rc;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment