ITS#7496, more for ITS#7483

Missing entries need to be checked at runtime too, not just slapcat.
Apparently some people will still try to run slapd even after slapadd
tells them their DB load was invalid.
This commit is contained in:
Howard Chu 2013-01-22 12:31:29 +00:00
parent ad9f847bf4
commit 2f53035a51

View File

@ -121,12 +121,17 @@ int mdb_id2edata(
MDB_val *data )
{
MDB_val key;
int rc;
key.mv_data = &id;
key.mv_size = sizeof(ID);
/* fetch it */
return mdb_cursor_get( mc, &key, data, MDB_SET );
rc = mdb_cursor_get( mc, &key, data, MDB_SET );
/* stubs from missing parents - DB is actually invalid */
if ( rc == MDB_SUCCESS && !data->mv_size )
rc = MDB_NOTFOUND;
return rc;
}
int mdb_id2entry(
@ -178,6 +183,9 @@ int mdb_id2entry(
return MDB_SUCCESS;
}
}
/* stubs from missing parents - DB is actually invalid */
if ( rc == MDB_SUCCESS && !data.mv_size )
rc = MDB_NOTFOUND;
if ( rc ) return rc;
rc = mdb_entry_decode( op, &data, e );