]> git.sur5r.net Git - openldap/commitdiff
ITS#5328 - return LDAP result code from config_back_entry_get (back-config bi_entry_g...
authorHallvard Furuseth <hallvard@openldap.org>
Mon, 11 Feb 2008 20:56:46 +0000 (20:56 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Mon, 11 Feb 2008 20:56:46 +0000 (20:56 +0000)
servers/slapd/bconfig.c

index 0be46d6b607ff693003323ab09d1b5a3d97f27d6..b65928e9a89deb91201df8484cf31085ecab959d 100644 (file)
@@ -5298,18 +5298,23 @@ int config_back_entry_get(
 {
        CfBackInfo *cfb;
        CfEntryInfo *ce, *last;
+       int rc = LDAP_NO_SUCH_OBJECT;
 
        cfb = (CfBackInfo *)op->o_bd->be_private;
 
        ce = config_find_base( cfb->cb_root, ndn, &last );
        if ( ce ) {
                *ent = ce->ce_entry;
-               if ( *ent && oc && !is_entry_objectclass_or_sub( *ent, oc ) ) {
-                       *ent = NULL;
+               if ( *ent ) {
+                       rc = LDAP_SUCCESS;
+                       if ( oc && !is_entry_objectclass_or_sub( *ent, oc ) ) {
+                               rc = LDAP_NO_SUCH_ATTRIBUTE;
+                               *ent = NULL;
+                       }
                }
        }
 
-       return ( *ent == NULL ? 1 : 0 );
+       return rc;
 }
 
 static void