Commit b8a22d05 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

fix ITS#2435

parent be410bf2
OpenLDAP 2.1 Change Log
OpenLDAP 2.1.18 Engineering
Fixed slave update when updateref missing bug (ITS#2435)
OpenLDAP 2.1.17 Release
Fixed libldap_r thread pool context bug (ITS#2404)
......
......@@ -210,11 +210,17 @@ do_add( Connection *conn, Operation *op )
if ( be == NULL ) {
BerVarray ref = referral_rewrite( default_referral,
NULL, &e->e_name, LDAP_SCOPE_DEFAULT );
if ( ref == NULL ) ref = default_referral;
if ( ref != NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref, NULL );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
if ( ref ) ber_bvarray_free( ref );
if ( ref != default_referral ) ber_bvarray_free( ref );
} else {
send_ldap_result( conn, op,
rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "referral missing", NULL, NULL );
}
goto done;
}
......@@ -328,13 +334,22 @@ do_add( Connection *conn, Operation *op )
defref = be->be_update_refs
? be->be_update_refs : default_referral;
ref = referral_rewrite( defref,
NULL, &e->e_name, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL, NULL, NULL,
ref ? ref : defref, NULL );
if ( defref ) {
ref = referral_rewrite( defref,
NULL, &e->e_name, LDAP_SCOPE_DEFAULT );
if ( ref ) ber_bvarray_free( ref );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL,
ref ? ref : defref, NULL );
if ( ref ) ber_bvarray_free( ref );
} else {
send_ldap_result( conn, op,
rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "referral missing",
NULL, NULL );
}
#endif /* SLAPD_MULTIMASTER */
}
} else {
......
......@@ -137,10 +137,17 @@ do_delete(
BerVarray ref = referral_rewrite( default_referral,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
if ( ref == NULL ) ref = default_referral;
if ( ref != NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref, NULL );
ber_bvarray_free( ref );
if ( ref != default_referral ) ber_bvarray_free( ref );
} else {
send_ldap_result( conn, op,
rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "referral missing", NULL, NULL );
}
goto cleanup;
}
......@@ -209,19 +216,28 @@ do_delete(
} else {
BerVarray defref = be->be_update_refs
? be->be_update_refs : default_referral;
BerVarray ref = referral_rewrite( default_referral,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
if ( defref != NULL ) {
BerVarray ref = referral_rewrite( defref,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL, NULL, NULL,
ref ? ref : defref, NULL );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL,
ref ? ref : defref, NULL );
ber_bvarray_free( ref );
ber_bvarray_free( ref );
} else {
send_ldap_result( conn, op,
rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "referral missing",
NULL, NULL );
}
#endif
}
} else {
send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "operation not supported within namingContext", NULL, NULL );
NULL, "operation not supported within namingContext",
NULL, NULL );
}
#if defined( LDAP_SLAPI )
......
......@@ -309,11 +309,17 @@ do_modify(
if ( (be = select_backend( &ndn, manageDSAit, 0 )) == NULL ) {
BerVarray ref = referral_rewrite( default_referral,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
if ( ref == NULL ) ref = default_referral;
if ( ref != NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref, NULL );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
ber_bvarray_free( ref );
if ( ref != default_referral ) ber_bvarray_free( ref );
} else {
send_ldap_result( conn, op,
rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "referral missing", NULL, NULL );
}
goto cleanup;
}
......@@ -435,13 +441,21 @@ do_modify(
} else {
BerVarray defref = be->be_update_refs
? be->be_update_refs : default_referral;
BerVarray ref = referral_rewrite( defref,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL, NULL, NULL,
ref ? ref : defref, NULL );
ber_bvarray_free( ref );
if ( defref != NULL ) {
BerVarray ref = referral_rewrite( defref,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL,
ref ? ref : defref, NULL );
ber_bvarray_free( ref );
} else {
send_ldap_result( conn, op,
rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "referral missing",
NULL, NULL );
}
#endif
}
} else {
......
......@@ -284,13 +284,20 @@ do_modrdn(
* if we don't hold it.
*/
if ( (be = select_backend( &ndn, manageDSAit, 0 )) == NULL ) {
BerVarray ref = referral_rewrite( default_referral,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
if ( default_referral != NULL ) {
BerVarray ref = referral_rewrite( default_referral,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL,
ref ? ref : default_referral, NULL );
ber_bvarray_free( ref );
ber_bvarray_free( ref );
} else {
send_ldap_result( conn, op,
rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "referral missing", NULL, NULL );
}
goto cleanup;
}
......@@ -386,13 +393,21 @@ do_modrdn(
} else {
BerVarray defref = be->be_update_refs
? be->be_update_refs : default_referral;
BerVarray ref = referral_rewrite( defref,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL, NULL, NULL,
ref ? ref : defref, NULL );
ber_bvarray_free( ref );
if ( defref ) {
BerVarray ref = referral_rewrite( defref,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL,
ref ? ref : defref, NULL );
ber_bvarray_free( ref );
} else {
send_ldap_result( conn, op,
rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "referral missing",
NULL, NULL );
}
#endif
}
} else {
......
Markdown is supported
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