Commit 6020fe58 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Modified slapd to be slurpd friendly.

	Slurpd incorrectly sends a separate attribute for each value of an
	attribute which caused slapd to complain.  Hacked slapd/add.c
	to merge values.
	Slurpd uses version 2 and hence cannot set ManageDSAit.  Hack
	slapd/back-ldbm/referral.c such that if update_ndn matches
	o_ndn, no referrals are returned.
Fix replication tests
	ldapmodify must be made against master as no rebind proc exists
	final ldapsearch should not chase
Fix referral tests
	Use -C option as needed
parent 1a862732
......@@ -285,8 +285,34 @@ static int slap_mods2entry(
attr = attr_find( (*e)->e_attrs, mods->sml_desc );
if( attr != NULL ) {
#define SLURPD_FRIENDLY
#ifdef SLURPD_FRIENDLY
ber_len_t i,j;
for( i=0; attr->a_vals[i]; i++ ) {
/* count them */
}
for( j=0; mods->sml_bvalues[j]; j++ ) {
/* count them */
}
j++; /* NULL */
attr->a_vals = ch_realloc( attr->a_vals,
sizeof( struct berval * ) * (i+j) );
/* should check for duplicates */
memcpy( &attr->a_vals[i], mods->sml_bvalues,
sizeof( struct berval * ) * j );
/* trim the mods array */
ch_free( mods->sml_bvalues );
mods->sml_bvalues = NULL;
continue;
#else
*text = "attribute provided more than once";
return LDAP_OPERATIONS_ERROR;
return LDAP_TYPE_OR_VALUE_EXISTS;
#endif
}
attr = ch_calloc( 1, sizeof(Attribute) );
......
......@@ -38,6 +38,13 @@ ldbm_back_referrals(
return rc;
}
if( be->be_update_ndn != NULL &&
!strcmp( be->be_update_ndn, op->o_ndn ) )
{
/* let op take care of updating */
return rc;
}
/* get entry with reader lock */
e = dn2entry_r( be, ndn, &matched );
if ( e == NULL ) {
......
......@@ -12,7 +12,7 @@ schemacheck off
pidfile ./test-repl/slapd.pid
argsfile ./test-repl/slapd.args
referral "ldap://localhost:9009/"
#referral "ldap://localhost:9009/"
#######################################################################
# ldbm database definitions
......
......@@ -81,13 +81,13 @@ fi
echo "Waiting 15 seconds for slurpd to send changes..."
sleep 15
echo "Using ldapmodify to modify slave directory..."
echo "Using ldapmodify to modify master directory..."
#
# Do some modifications
#
$LDAPMODIFY -v -D "$MANAGERDN" -h localhost -p $SLAVEPORT -w $PASSWD > \
$LDAPMODIFY -v -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD > \
$TESTOUT 2>&1 << EOMODS
dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
changetype: modify
......
......@@ -69,7 +69,7 @@ done
cat /dev/null > $SEARCHOUT
echo "Testing exact searching..."
$LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
$LDAPSEARCH -C -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
'sn=jensen' >> $SEARCHOUT 2>&1
if test $RC != 0 ; then
echo "ldapsearch failed!"
......@@ -78,7 +78,7 @@ if test $RC != 0 ; then
fi
echo "Testing OR searching..."
$LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
$LDAPSEARCH -C -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
'(|(objectclass=groupofnames)(sn=jones))' >> $SEARCHOUT 2>&1
if test $RC != 0 ; then
echo "ldapsearch failed!"
......@@ -87,7 +87,7 @@ if test $RC != 0 ; then
fi
echo "Testing AND matching and ends-with searching..."
$LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
$LDAPSEARCH -C -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
'(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1
if test $RC != 0 ; then
echo "ldapsearch failed!"
......@@ -96,7 +96,7 @@ if test $RC != 0 ; then
fi
echo "Testing NOT searching..."
$LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
$LDAPSEARCH -C -S "" -b "$BASEDN" -h localhost -p $SLAVEPORT \
'(!(objectclass=person))' >> $SEARCHOUT 2>&1
if test $RC != 0 ; then
echo "ldapsearch failed!"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment