mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-04-24 15:32:22 +08:00
Working slapindex!
This commit is contained in:
parent
c49960df72
commit
57deefc94f
@ -137,6 +137,10 @@ Entry* ldbm_tool_entry_get( BackendDB *be, ID id )
|
||||
e = str2entry( data.dptr );
|
||||
ldbm_datum_free( id2entry->dbc_db, data );
|
||||
|
||||
if( e != NULL ) {
|
||||
e->e_id = id;
|
||||
}
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
@ -197,9 +201,19 @@ int ldbm_tool_entry_reindex(
|
||||
ID id )
|
||||
{
|
||||
int rc;
|
||||
Entry *e = ldbm_tool_entry_get( be, id );
|
||||
Entry *e;
|
||||
|
||||
if( e == NULL ) return -1;
|
||||
Debug( LDAP_DEBUG_ARGS, "=> ldbm_tool_entry_reindex( %ld )\n",
|
||||
(long) id, 0, 0 );
|
||||
|
||||
e = ldbm_tool_entry_get( be, id );
|
||||
|
||||
if( e == NULL ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"ldbm_tool_entry_reindex:: could not locate id=%ld\n",
|
||||
(long) id, 0, 0 );
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* just (re)add them for now
|
||||
@ -207,6 +221,10 @@ int ldbm_tool_entry_reindex(
|
||||
* will zap index databases
|
||||
*
|
||||
*/
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE, "=> ldbm_tool_entry_reindex( %ld, \"%s\" )\n",
|
||||
id, e->e_dn, 0 );
|
||||
|
||||
rc = index_entry_add( be, e, e->e_attrs );
|
||||
|
||||
entry_free( e );
|
||||
|
@ -22,7 +22,7 @@ suffix "o=University of Michigan, c=US"
|
||||
directory ./test-db
|
||||
rootdn "cn=Manager, o=University of Michigan, c=US"
|
||||
rootpw secret
|
||||
index objectClass eq
|
||||
index objectclass eq
|
||||
index cn,sn,uid pres,eq,sub
|
||||
dbnosync
|
||||
dbnolocking
|
||||
|
@ -18,21 +18,20 @@ echo "Cleaning up in $DBDIR..."
|
||||
rm -f $DBDIR/[!C]*
|
||||
|
||||
echo "Running slapadd to build slapd database..."
|
||||
# $SLAPADD -f $MCONF -l $LDIF
|
||||
$SLAPADD -f $CONF -l $LDIF
|
||||
$SLAPADD -f $MCONF -l $LDIF
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "slapadd failed ($RC)!"
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
# echo "Running slapindex to index slapd database..."
|
||||
# $SLAPINDEX -f $CONF
|
||||
# RC=$?
|
||||
# if test $RC != 0 ; then
|
||||
# echo "slapindex failed ($RC)!"
|
||||
# exit $RC
|
||||
# fi
|
||||
echo "Running slapindex to index slapd database..."
|
||||
$SLAPINDEX -f $CONF
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "slapindex failed ($RC)!"
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Starting slapd on TCP/IP port $PORT..."
|
||||
$SLAPD -f $CONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
|
||||
|
Loading…
x
Reference in New Issue
Block a user