/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2006 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
goto done;
}
- rs->sr_err = slap_mods_check( modlist, &rs->sr_text,
+ rs->sr_err = slap_mods_check( op, modlist, &rs->sr_text,
textbuf, textlen, NULL );
if ( rs->sr_err != LDAP_SUCCESS ) {
int repl_user = be_isupdate( op );
if ( !SLAP_SINGLE_SHADOW(op->o_bd) || repl_user ) {
int update = !BER_BVISEMPTY( &op->o_bd->be_update_ndn );
- slap_callback cb = { NULL, slap_replog_cb, NULL, NULL };
op->o_bd = op_be;
send_ldap_result( op, rs );
goto done;
}
-
-#if 0 /* This is a no-op since *modtail is NULL */
- rs->sr_err = slap_mods2entry( *modtail, &op->ora_e,
- 0, 0, &rs->sr_text, textbuf, textlen );
- if ( rs->sr_err != LDAP_SUCCESS ) {
- send_ldap_result( op, rs );
- goto done;
- }
-#endif
-
- cb.sc_next = op->o_callback;
- op->o_callback = &cb;
}
rc = op->o_bd->be_add( op, rs );
#endif
}
-#if 0 /* checked for duplicates in slap_mods_check */
- if( mods->sml_values[1].bv_val != NULL ) {
- /* check for duplicates */
- int i, j, rc, match;
- MatchingRule *mr = mods->sml_desc->ad_type->sat_equality;
-
- for ( i = 1; mods->sml_values[i].bv_val != NULL; i++ ) {
- /* test asserted values against themselves */
- for( j = 0; j < i; j++ ) {
- rc = ordered_value_match( &match, mods->sml_desc, mr,
- SLAP_MR_EQUALITY
- | SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX
- | SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH
- | SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
- mods->sml_nvalues
- ? &mods->sml_nvalues[i]
- : &mods->sml_values[i],
- mods->sml_nvalues
- ? &mods->sml_nvalues[j]
- : &mods->sml_values[j],
- text );
-
- if ( rc == LDAP_SUCCESS && match == 0 ) {
- /* value exists already */
- snprintf( textbuf, textlen,
- "%s: value #%d provided more than once",
- mods->sml_desc->ad_cname.bv_val, j );
- *text = textbuf;
- return LDAP_TYPE_OR_VALUE_EXISTS;
-
- } else if ( rc != LDAP_SUCCESS ) {
- return rc;
- }
- }
- }
- }
-#endif
-
attr = attr_alloc( mods->sml_desc );
/* move values to attr structure */
}
ptr = ber_bvchr( &csn, '#' );
if ( ptr ) {
- timestamp.bv_len = ptr - csn.bv_val;
- if ( timestamp.bv_len >= sizeof(timebuf) ) /* ?!? */
- timestamp.bv_len = sizeof(timebuf) - 1;
+ timestamp.bv_len = STRLENOF("YYYYMMDDHHMMSSZ");
AC_MEMCPY( timebuf, csn.bv_val, timestamp.bv_len );
+ timebuf[timestamp.bv_len-1] = 'Z';
timebuf[timestamp.bv_len] = '\0';
} else {
time_t now = slap_get_time();