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) );
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 ) {
pidfile ./test-repl/slapd.pid
argsfile ./test-repl/slapd.args
-referral "ldap://localhost:9009/"
+#referral "ldap://localhost:9009/"
#######################################################################
# ldbm database definitions
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
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!"
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!"
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!"
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!"