From 827c4277e198fe73901e7b31c3164daa637cca74 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 8 Apr 2003 11:20:18 +0000 Subject: [PATCH] mix refresh and fix; may need further work --- servers/slapd/back-dnssrv/compare.c | 14 +++++++------- servers/slapd/back-dnssrv/search.c | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/servers/slapd/back-dnssrv/compare.c b/servers/slapd/back-dnssrv/compare.c index 980843e31a..2abf678290 100644 --- a/servers/slapd/back-dnssrv/compare.c +++ b/servers/slapd/back-dnssrv/compare.c @@ -17,17 +17,17 @@ int dnssrv_back_compare( - Backend *be, - Connection *conn, - Operation *op, - const char *dn, - const char *ndn, - AttributeAssertion *ava + Operation *op, + SlapReply *rs ) { +#if 0 assert( get_manageDSAit( op ) ); +#endif + send_ldap_error( op, rs, LDAP_OTHER, + "Operation not supported within naming context" ); /* not implemented */ - return LDAP_OTHER; + return 1; } diff --git a/servers/slapd/back-dnssrv/search.c b/servers/slapd/back-dnssrv/search.c index aa6123a994..35dcdcc3fb 100644 --- a/servers/slapd/back-dnssrv/search.c +++ b/servers/slapd/back-dnssrv/search.c @@ -30,13 +30,25 @@ dnssrv_back_search( char *refdn; struct berval nrefdn = { 0, NULL }; BerVarray urls = NULL; + int manageDSAit; - assert( get_manageDSAit( op ) ); + rs->sr_ref = NULL; + + manageDSAit = get_manageDSAit( op ); + /* + * FIXME: we may return a referral if manageDSAit is not set + */ + if ( ! manageDSAit ) { + send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, + "manageDSAit must be set" ); + goto done; + } if( ldap_dn2domain( op->o_req_dn.bv_val, &domain ) || domain == NULL ) { rs->sr_err = LDAP_REFERRAL; rs->sr_ref = default_referral; send_ldap_result( op, rs ); + rs->sr_ref = NULL; goto done; } @@ -120,6 +132,7 @@ dnssrv_back_search( rs->sr_matched = refdn; rs->sr_err = LDAP_NO_SUCH_OBJECT; send_ldap_result( op, rs ); + rs->sr_matched = NULL; } else if ( op->oq_search.rs_scope == LDAP_SCOPE_ONELEVEL ) { send_ldap_error( op, rs, LDAP_SUCCESS, NULL ); @@ -196,6 +209,8 @@ dnssrv_back_search( rs->sr_entry = e; rs->sr_attrs = op->oq_search.rs_attrs; send_search_entry( op, rs ); + rs->sr_entry = NULL; + rs->sr_attrs = NULL; } entry_free( e ); @@ -214,3 +229,4 @@ done: if( urls != NULL ) ber_bvarray_free( urls ); return 0; } + -- 2.39.5