]> git.sur5r.net Git - openldap/commitdiff
fix return code in case the asserted DN does not exist (ITS#4224)
authorPierangelo Masarati <ando@openldap.org>
Tue, 29 Nov 2005 00:09:39 +0000 (00:09 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 29 Nov 2005 00:09:39 +0000 (00:09 +0000)
servers/slapd/overlays/dyngroup.c
servers/slapd/overlays/dynlist.c

index 620224c14c3f8c14430b3332ca78813348de97df..dd056fc39bc3743ee9d2e9c4d3842a0898b20ecb 100644 (file)
@@ -67,8 +67,15 @@ dyngroup_response( Operation *op, SlapReply *rs )
                                rs->sr_err = backend_group( op, NULL, &op->o_req_ndn,
                                        &op->oq_compare.rs_ava->aa_value, NULL, ap->ap_uri );
                                op->o_do_not_cache = cache;
-                               if ( rs->sr_err == LDAP_SUCCESS )
+                               switch ( rs->sr_err ) {
+                               case LDAP_SUCCESS:
                                        rs->sr_err = LDAP_COMPARE_TRUE;
+                                       break;
+
+                               case LDAP_NO_SUCH_OBJECT:
+                                       rs->sr_err = LDAP_COMPARE_FALSE;
+                                       break;
+                               }
                                break;
                        }
                }
index 3ad2a6bee80f9d571cc81335180c9fe3db429ffa..75e449ed224860fbbea8d15d0e735079ee0b0283 100644 (file)
@@ -511,11 +511,23 @@ dynlist_compare( Operation *op, SlapReply *rs )
                int cache = op->o_do_not_cache;
                                
                op->o_do_not_cache = 1;
-                       rs->sr_err = backend_group( op, NULL, &op->o_req_ndn,
+               rs->sr_err = backend_group( op, NULL, &op->o_req_ndn,
                        &op->oq_compare.rs_ava->aa_value, dli->dli_oc, dli->dli_ad );
                op->o_do_not_cache = cache;
-               if ( rs->sr_err == LDAP_SUCCESS ) {
+               switch ( rs->sr_err ) {
+               case LDAP_SUCCESS:
                        rs->sr_err = LDAP_COMPARE_TRUE;
+                       break;
+
+               case LDAP_NO_SUCH_OBJECT:
+                       /* NOTE: backend_group() returns noSuchObject
+                        * if op_ndn does not exist; however, since
+                        * dynamic list expansion means that the
+                        * member attribute is virtually present, the
+                        * non-existence of the asserted value implies
+                        * the assertion is FALSE rather than
+                        * UNDEFINED */
+                       rs->sr_err = LDAP_COMPARE_FALSE;
                }
 
                return SLAP_CB_CONTINUE;