]> git.sur5r.net Git - openldap/commitdiff
mix refresh and fix; may need further work
authorPierangelo Masarati <ando@openldap.org>
Tue, 8 Apr 2003 11:20:18 +0000 (11:20 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 8 Apr 2003 11:20:18 +0000 (11:20 +0000)
servers/slapd/back-dnssrv/compare.c
servers/slapd/back-dnssrv/search.c

index 980843e31a0a8af94eb0c191b83523a5f2c8490b..2abf6782902912211dc7512cceb59e4ef4fffe1c 100644 (file)
 
 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;
 }
index aa6123a9948ffdbd02720cfbc2821877187ef15a..35dcdcc3fb3ae29b2bacd1d66ab25468b518e903 100644 (file)
@@ -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;
 }
+