- return bdb_id2entry( be, NULL, id, e );
+ int rc = bdb_id2entry( be, NULL, id, e );
+
+ if ( rc == DB_NOTFOUND && id == 0 ) {
+ Entry *dummy = ch_calloc( 1, sizeof(Entry) );
+ struct berval gluebv = BER_BVC("glue");
+ dummy->e_name.bv_val = ch_strdup( "" );
+ dummy->e_nname.bv_val = ch_strdup( "" );
+ attr_merge_one( dummy, slap_schema.si_ad_objectClass, &gluebv, NULL );
+ attr_merge_one( dummy, slap_schema.si_ad_structuralObjectClass,
+ &gluebv, NULL );
+ *e = dummy;
+ rc = LDAP_SUCCESS;
+ }
+ return rc;