Currently discovered via a "feature", but should use a control.
Start of a control made, but needs to be better integrated (with
auto use in ldapmodify(1)).
} LDAPControl;
/* LDAP Controls */
-#define LDAP_CONTROL_ASSERT "1.3.6.1.4.1.4203.666.5.9"
-#define LDAP_CONTROL_PRE_READ_BACK "1.3.6.1.4.1.4203.666.5.10.1"
-#define LDAP_CONTROL_POST_READ_BACK "1.3.6.1.4.1.4203.666.5.10.2"
+#define LDAP_CONTROL_ASSERT "1.3.6.1.4.1.4203.666.5.9"
+#define LDAP_CONTROL_PRE_READ_BACK "1.3.6.1.4.1.4203.666.5.10.1"
+#define LDAP_CONTROL_POST_READ_BACK "1.3.6.1.4.1.4203.666.5.10.2"
+#define LDAP_CONTROL_MODIFY_INCREMENT "1.3.6.1.4.1.4203.666.5.11"
-#define LDAP_CONTROL_VALUESRETURNFILTER "1.2.826.0.1.334810.2.3"
-#define LDAP_CONTROL_SUBENTRIES "1.3.6.1.4.1.4203.1.10.1"
-#define LDAP_CONTROL_NOOP "1.3.6.1.4.1.4203.1.10.2"
-#define LDAP_CONTROL_MANAGEDSAIT "2.16.840.1.113730.3.4.2"
-#define LDAP_CONTROL_PROXY_AUTHZ "2.16.840.1.113730.3.4.18"
+#define LDAP_CONTROL_VALUESRETURNFILTER "1.2.826.0.1.334810.2.3"
+#define LDAP_CONTROL_SUBENTRIES "1.3.6.1.4.1.4203.1.10.1"
+#define LDAP_CONTROL_NOOP "1.3.6.1.4.1.4203.1.10.2"
+#define LDAP_CONTROL_MANAGEDSAIT "2.16.840.1.113730.3.4.2"
+#define LDAP_CONTROL_PROXY_AUTHZ "2.16.840.1.113730.3.4.18"
#if 0
#define LDAP_CONTROL_DUPENT_REQUEST "2.16.840.1.113719.1.27.101.1"
#define LDAP_CONTROL_DUPENT LDAP_CONTROL_DUPENT_REQUEST
#endif
-#define LDAP_CONTROL_PAGEDRESULTS "1.2.840.113556.1.4.319"
+#define LDAP_CONTROL_PAGEDRESULTS "1.2.840.113556.1.4.319"
#define LDAP_SYNC 2
#ifdef LDAP_SYNC
#define LDAP_FEATURE_ABSOLUTE_FILTERS "1.3.6.1.4.1.4203.1.5.3" /* (&) (|) */
#define LDAP_FEATURE_LANGUAGE_TAG_OPTIONS "1.3.6.1.4.1.4203.1.5.4"
#define LDAP_FEATURE_LANGUAGE_RANGE_OPTIONS "1.3.6.1.4.1.4203.1.5.5"
-#define LDAP_FEATURE_MODIFY_INCREMENT "1.3.6.1.4.1.4203.1.5.6"
+#define LDAP_FEATURE_MODIFY_INCREMENT "1.3.6.1.4.1.4203.666.5.6"
/*
* specific LDAP instantiations of BER types we know about
/* indicate system schema supported */
be->be_flags |=
+ SLAP_BFLAG_INCREMENT |
#ifdef BDB_SUBENTRIES
SLAP_BFLAG_SUBENTRIES |
#endif
}
break;
+ case LDAP_MOD_INCREMENT:
+#ifdef NEW_LOGGING
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "bdb_modify_internal: increment\n", 0, 0, 0 );
+#else
+ Debug(LDAP_DEBUG_ARGS,
+ "bdb_modify_internal: increment\n", 0, 0, 0);
+#endif
+ err = modify_increment_values( e, mod, get_permissiveModify(op),
+ text, textbuf, textlen );
+ if( err != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG ( OPERATION, ERR,
+ "bdb_modify_internal: %d %s\n", err, *text, 0 );
+#else
+ Debug(LDAP_DEBUG_ARGS,
+ "bdb_modify_internal: %d %s\n",
+ err, *text, 0);
+#endif
+ }
+ break;
+
case SLAP_MOD_SOFTADD:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
/* indicate system schema supported */
be->be_flags |=
+ SLAP_BFLAG_INCREMENT |
#ifdef LDBM_SUBENTRIES
SLAP_BFLAG_SUBENTRIES |
#endif
}
break;
+ case LDAP_MOD_INCREMENT:
+#ifdef NEW_LOGGING
+ LDAP_LOG( BACK_LDBM, DETAIL1,
+ "ldbm_modify_internal: increment\n",0,0,0);
+#else
+ Debug(LDAP_DEBUG_ARGS,
+ "ldbm_modify_internal: increment\n",0,0,0);
+#endif
+
+ rc = modify_increment_values( e, mod, get_permissiveModify( op ),
+ text, textbuf, textlen );
+ if( rc != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( BACK_LDBM, INFO,
+ "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
+#else
+ Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
+ rc, *text, 0);
+#endif
+ }
+ break;
+
case SLAP_MOD_SOFTADD:
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
if( ctrls ) {
for( ; *ctrls != NULL ; ctrls++ ) {
- if( (*ctrls)->ldctl_iscritical &&
- !ldap_charray_inlist( op->o_bd->be_controls, (*ctrls)->ldctl_oid ) )
+ if( (*ctrls)->ldctl_iscritical && !ldap_charray_inlist(
+ op->o_bd->be_controls, (*ctrls)->ldctl_oid ) )
{
rs->sr_text = "control unavailable in context";
rs->sr_err = LDAP_UNAVAILABLE_CRITICAL_EXTENSION;
static SLAP_CTRL_PARSE_FN parseAssert;
static SLAP_CTRL_PARSE_FN parseProxyAuthz;
static SLAP_CTRL_PARSE_FN parseManageDSAit;
+static SLAP_CTRL_PARSE_FN parseModifyIncrement;
static SLAP_CTRL_PARSE_FN parseNoOp;
static SLAP_CTRL_PARSE_FN parsePagedResults;
static SLAP_CTRL_PARSE_FN parseValuesReturnFilter;
SLAP_CTRL_HIDE|SLAP_CTRL_SEARCH, NULL,
parseLdupSync, LDAP_SLIST_ENTRY_INITIALIZER(next) },
#endif
+ { LDAP_CONTROL_MODIFY_INCREMENT,
+ SLAP_CTRL_MODIFY, NULL,
+ parseModifyIncrement, LDAP_SLIST_ENTRY_INITIALIZER(next) },
{ LDAP_CONTROL_MANAGEDSAIT,
SLAP_CTRL_ACCESS, NULL,
parseManageDSAit, LDAP_SLIST_ENTRY_INITIALIZER(next) },
return rs->sr_err;
}
+static int parseModifyIncrement (
+ Operation *op,
+ SlapReply *rs,
+ LDAPControl *ctrl )
+{
+#if 0
+ if ( op->o_parseModifyIncrement != SLAP_NO_CONTROL ) {
+ rs->sr_text = "modifyIncrement control specified multiple times";
+ return LDAP_PROTOCOL_ERROR;
+ }
+#endif
+
+ if ( ctrl->ldctl_value.bv_len ) {
+ rs->sr_text = "modifyIncrement control value not empty";
+ return LDAP_PROTOCOL_ERROR;
+ }
+
+#if 0
+ op->o_parseModifyIncrement = ctrl->ldctl_iscritical
+ ? SLAP_CRITICAL_CONTROL
+ : SLAP_NONCRITICAL_CONTROL;
+#endif
+
+ return LDAP_SUCCESS;
+}
+
static int parseManageDSAit (
Operation *op,
SlapReply *rs,
Slapi_PBlock *pb = op->o_pb;
#endif
int manageDSAit;
+ int increment = 0;
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ENTRY, "do_modify: enter\n", 0, 0, 0 );
case LDAP_MOD_REPLACE:
break;
+ case LDAP_MOD_INCREMENT:
+ if( op->o_protocol >= LDAP_VERSION3 ) {
+ increment++;
+ if ( mod->sml_values == NULL ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, ERR, "do_modify: "
+ "modify/increment operation (%ld) requires value\n",
+ (long)mop, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY, "do_modify: "
+ "modify/increment operation (%ld) requires value\n",
+ (long) mop, 0, 0 );
+#endif
+
+ send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
+ "modify/increment operation requires value" );
+ goto cleanup;
+ }
+
+ if( mod->sml_values[1].bv_val ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, ERR, "do_modify: modify/increment "
+ "operation (%ld) requires single value\n",
+ (long)mop, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY, "do_modify: modify/increment "
+ "operation (%ld) requires single value\n",
+ (long) mop, 0, 0 );
+#endif
+
+ send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
+ "modify/increment operation requires single value" );
+ goto cleanup;
+ }
+
+ break;
+ }
+ /* fall thru */
+
default: {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
- "do_modify: invalid modify operation (%ld)\n",
+ "do_modify: unrecognized modify operation (%ld)\n",
(long)mop, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
- "do_modify: invalid modify operation (%ld)\n",
+ "do_modify: unrecognized modify operation (%ld)\n",
(long) mop, 0, 0 );
#endif
for ( tmp = modlist; tmp != NULL; tmp = tmp->sml_next ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, DETAIL1, "\t%s: %s\n",
- tmp->sml_op == LDAP_MOD_ADD ?
- "add" : (tmp->sml_op == LDAP_MOD_DELETE ?
- "delete" : "replace"), tmp->sml_type.bv_val, 0 );
+ tmp->sml_op == LDAP_MOD_ADD ? "add" :
+ (tmp->sml_op == LDAP_MOD_INCREMENT ? "increment" :
+ (tmp->sml_op == LDAP_MOD_DELETE ? "delete" :
+ "replace")), tmp->sml_type.bv_val, 0 );
if ( tmp->sml_values == NULL ) {
LDAP_LOG( OPERATION, DETAIL1, "\t\tno values", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ARGS, "\t%s: %s\n",
- tmp->sml_op == LDAP_MOD_ADD
- ? "add" : (tmp->sml_op == LDAP_MOD_DELETE
- ? "delete" : "replace"), tmp->sml_type.bv_val, 0 );
+ tmp->sml_op == LDAP_MOD_ADD ? "add" :
+ (tmp->sml_op == LDAP_MOD_INCREMENT ? "increment" :
+ (tmp->sml_op == LDAP_MOD_DELETE ? "delete" :
+ "replace")), tmp->sml_type.bv_val, 0 );
if ( tmp->sml_values == NULL ) {
Debug( LDAP_DEBUG_ARGS, "%s\n",
if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref );
} else {
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
- "referral missing" );
+ "referral missing" );
}
goto cleanup;
}
goto cleanup;
}
+ /* check for modify/increment support */
+ if( increment && !SLAP_INCREMENT( op->o_bd ) ) {
+ send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
+ "modify/increment not supported in context" );
+ }
+
#if defined( LDAP_SLAPI )
slapi_x_pblock_set_operation( pb, op );
slapi_pblock_set( pb, SLAPI_MODIFY_TARGET, (void *)dn.bv_val );
*/
#if defined(LDAP_SYNCREPL) && !defined(SLAPD_MULTIMASTER)
if ( !op->o_bd->syncinfo &&
- ( !op->o_bd->be_update_ndn.bv_len || repl_user ))
+ ( !op->o_bd->be_update_ndn.bv_len || repl_user ))
#elif defined(LDAP_SYNCREPL) && defined(SLAPD_MULTIMASTER)
if ( !op->o_bd->syncinfo ) /* LDAP_SYNCREPL overrides MM */
#elif !defined(LDAP_SYNCREPL) && !defined(SLAPD_MULTIMASTER)
}
if ( is_at_obsolete( ad->ad_type ) &&
- ( ml->sml_op == LDAP_MOD_ADD || ml->sml_values != NULL ) )
+ (( ml->sml_op != LDAP_MOD_REPLACE &&
+ ml->sml_op != LDAP_MOD_DELETE ) ||
+ ml->sml_values != NULL ))
{
/*
* attribute is obsolete,
return LDAP_CONSTRAINT_VIOLATION;
}
+ if ( ml->sml_op == LDAP_MOD_INCREMENT &&
+#ifdef SLAPD_REAL_SYNTAX
+ !is_at_syntax( ad->ad_type, SLAPD_REAL_SYNTAX ) &&
+#endif
+ !is_at_syntax( ad->ad_type, SLAPD_INTEGER_SYNTAX ) )
+ {
+ /*
+ * attribute values must be INTEGER or REAL
+ */
+ snprintf( textbuf, textlen,
+ "%s: attribute syntax inappropriate for increment",
+ ml->sml_type.bv_val );
+ *text = textbuf;
+ return LDAP_CONSTRAINT_VIOLATION;
+ }
+
/*
* check values
*/
ml->sml_nvalues[nvals].bv_val = NULL;
ml->sml_nvalues[nvals].bv_len = 0;
-
- } else {
}
}
}
if( global_schemacheck ) {
int rc = mods_structural_class( mods, &tmpval,
text, textbuf, textlen );
- if( rc != LDAP_SUCCESS ) {
- return rc;
- }
+ if( rc != LDAP_SUCCESS ) return rc;
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
mod->sml_op = mop;
#include "portable.h"
+#include <ac/string.h>
+
#include "slap.h"
int
Modification *mod,
int permissive,
const char **text,
- char *textbuf, size_t textlen
-)
+ char *textbuf, size_t textlen )
{
int i, j;
int matched;
} else {
rc = modify_check_duplicates( mod->sm_desc, mr,
- a ? a->a_vals : NULL, mod->sm_bvalues,
- permissive, text, textbuf, textlen );
+ a ? a->a_vals : NULL, mod->sm_bvalues,
+ permissive, text, textbuf, textlen );
if ( permissive && rc == LDAP_TYPE_OR_VALUE_EXISTS ) {
return LDAP_SUCCESS;
}
/* no - add them */
- if( attr_merge( e, mod->sm_desc, mod->sm_values, mod->sm_nvalues ) != 0 )
- {
+ if( attr_merge( e, mod->sm_desc, mod->sm_values, mod->sm_nvalues ) != 0 ) {
/* this should return result of attr_merge */
*text = textbuf;
snprintf( textbuf, textlen,
for ( i = 0; mod->sm_values[i].bv_val != NULL; i++ ) {
int found = 0;
- for ( j = 0; a->a_vals[j].bv_val != NULL; j++ )
- {
+ for ( j = 0; a->a_vals[j].bv_val != NULL; j++ ) {
int match;
if( mod->sm_nvalues ) {
break;
}
-
if ( found == 0 ) {
*text = textbuf;
snprintf( textbuf, textlen,
}
/* compact array skipping dummies */
- for ( k = 0, j = 0; a->a_vals[k].bv_val != NULL; k++ )
- {
+ for ( k = 0, j = 0; a->a_vals[k].bv_val != NULL; k++ ) {
/* skip dummies */
if( a->a_vals[k].bv_val == &dummy ) {
assert( a->a_nvals == NULL || a->a_nvals[k].bv_val == &dummy );
Modification *mod,
int permissive,
const char **text,
- char *textbuf, size_t textlen
-)
+ char *textbuf, size_t textlen )
{
(void) attr_delete( &e->e_attrs, mod->sm_desc );
return LDAP_SUCCESS;
}
+int
+modify_increment_values(
+ Entry *e,
+ Modification *mod,
+ int permissive,
+ const char **text,
+ char *textbuf, size_t textlen )
+{
+ Attribute *a;
+
+ a = attr_find( e->e_attrs, mod->sm_desc );
+ if( a == NULL ) {
+ *text = textbuf;
+ snprintf( textbuf, textlen,
+ "modify/increment: %s: no such attribute",
+ mod->sm_desc->ad_cname.bv_val );
+ return LDAP_NO_SUCH_ATTRIBUTE;
+ }
+
+
+ if ( !strcmp( a->a_desc->ad_type->sat_syntax_oid, SLAPD_INTEGER_SYNTAX )) {
+ int i;
+ char str[sizeof(long)*3 + 2]; /* overly long */
+ long incr = atol( mod->sm_bvalues[0].bv_val );
+
+ /* treat zero and errors as a no-op */
+ if( incr == 0 ) {
+ return LDAP_SUCCESS;
+ }
+
+ for( i=0; a->a_nvals[i].bv_val != NULL; i++ ) {
+ char *tmp;
+ long value = atol( a->a_nvals[i].bv_val );
+ size_t strln = snprintf( str, sizeof(str), "%ld", value+incr );
+
+ tmp = SLAP_REALLOC( a->a_nvals[i].bv_val, strln+1 );
+ if( tmp == NULL ) {
+ *text = "modify/increment: reallocation error";
+ return LDAP_OTHER;;
+ }
+ a->a_nvals[i].bv_val = tmp;
+ a->a_nvals[i].bv_len = strln;
+
+ AC_MEMCPY( a->a_nvals[i].bv_val, str, strln+1 );
+ }
+
+ } else {
+ snprintf( textbuf, textlen,
+ "modify/increment: %s: increment not supported for value syntax %s",
+ mod->sm_desc->ad_cname.bv_val,
+ a->a_desc->ad_type->sat_syntax_oid );
+ return LDAP_CONSTRAINT_VIOLATION;
+ }
+
+ return LDAP_SUCCESS;
+}
+
void
slap_mod_free(
Modification *mod,
- int freeit
-)
+ int freeit )
{
if ( mod->sm_values != NULL ) ber_bvarray_free( mod->sm_values );
mod->sm_values = NULL;
void
slap_mods_free(
- Modifications *ml
-)
+ Modifications *ml )
{
Modifications *next;
Modification *mod,
int permissive,
const char **text, char *textbuf, size_t textlen );
+LDAP_SLAPD_F( int ) modify_increment_values( Entry *e,
+ Modification *mod,
+ int permissive,
+ const char **text, char *textbuf, size_t textlen );
LDAP_SLAPD_F( void ) slap_mod_free( Modification *mod, int freeit );
LDAP_SLAPD_F( void ) slap_mods_free( Modifications *mods );
if ( ri && ri->ri_attrs ) {
int is_in = ad_inlist( ml->sml_desc, ri->ri_attrs );
- if ( ( !is_in && !ri->ri_exclude ) || ( is_in && ri->ri_exclude ) ) {
+ if ( ( !is_in && !ri->ri_exclude )
+ || ( is_in && ri->ri_exclude ) )
+ {
continue;
}
}
case LDAP_MOD_REPLACE:
fprintf( fp, "replace: %s\n", type );
break;
+
+ case LDAP_MOD_INCREMENT:
+ fprintf( fp, "increment: %s\n", type );
+ break;
}
- if ( ml->sml_bvalues )
+ if ( ml->sml_bvalues ) {
print_vals( fp, &ml->sml_desc->ad_cname, ml->sml_bvalues );
+ }
fprintf( fp, "-\n" );
}
break;
/* $OpenLDAP$ */
-/* root_dse.c - Provides the ROOT DSA-Specific Entry
+/* root_dse.c - Provides the Root DSA-Specific Entry
*
* Copyright 1999-2003 The OpenLDAP Foundation.
* All rights reserved.
#endif
static struct berval supportedFeatures[] = {
- BER_BVC(LDAP_FEATURE_ALL_OPERATIONAL_ATTRS), /* all Operational Attributes ("+") */
- BER_BVC(LDAP_FEATURE_OBJECTCLASS_ATTRS), /* OCs in Attributes List */
+ BER_BVC(LDAP_FEATURE_ALL_OPERATIONAL_ATTRS), /* All Op Attrs (+) */
+ BER_BVC(LDAP_FEATURE_OBJECTCLASS_ATTRS), /* OCs in Attrs List (+person) */
BER_BVC(LDAP_FEATURE_ABSOLUTE_FILTERS), /* (&) and (|) search filters */
BER_BVC(LDAP_FEATURE_LANGUAGE_TAG_OPTIONS), /* Language Tag Options */
BER_BVC(LDAP_FEATURE_LANGUAGE_RANGE_OPTIONS), /* Language Range Options */
+ BER_BVC(LDAP_FEATURE_MODIFY_INCREMENT), /* Modify/increment */
{0,NULL}
};
vals[0].bv_val = "top";
vals[0].bv_len = sizeof("top")-1;
- if( attr_merge( e, ad_objectClass, vals, NULL ) )
- {
+ if( attr_merge( e, ad_objectClass, vals, NULL ) ) {
return LDAP_OTHER;
}
vals[0].bv_val = "OpenLDAProotDSE";
vals[0].bv_len = sizeof("OpenLDAProotDSE")-1;
- if( attr_merge( e, ad_objectClass, vals, NULL ) )
+ if( attr_merge( e, ad_objectClass, vals, NULL ) ) {
return LDAP_OTHER;
- if( attr_merge( e, ad_structuralObjectClass, vals, NULL ) )
+ }
+ if( attr_merge( e, ad_structuralObjectClass, vals, NULL ) ) {
return LDAP_OTHER;
+ }
for ( i = 0; i < nbackends; i++ ) {
if ( backends[i].be_flags & SLAP_BFLAG_MONITOR ) {
vals[0] = backends[i].be_suffix[0];
nvals[0] = backends[i].be_nsuffix[0];
- if( attr_merge( e, ad_monitorContext, vals, nvals ) )
- {
+ if( attr_merge( e, ad_monitorContext, vals, nvals ) ) {
return LDAP_OTHER;
}
continue;
for ( j = 0; backends[i].be_suffix[j].bv_val != NULL; j++ ) {
vals[0] = backends[i].be_suffix[j];
nvals[0] = backends[i].be_nsuffix[0];
- if( attr_merge( e, ad_namingContexts, vals, nvals ) )
- {
+ if( attr_merge( e, ad_namingContexts, vals, nvals ) ) {
return LDAP_OTHER;
}
}
snprintf(buf, sizeof buf, "%d", i);
vals[0].bv_val = buf;
vals[0].bv_len = strlen( vals[0].bv_val );
- if( attr_merge( e, ad_supportedLDAPVersion, vals, NULL ) )
- {
+ if( attr_merge( e, ad_supportedLDAPVersion, vals, NULL ) ) {
return LDAP_OTHER;
}
}
for ( i=0; supportedSASLMechanisms[i] != NULL; i++ ) {
vals[0].bv_val = supportedSASLMechanisms[i];
vals[0].bv_len = strlen( vals[0].bv_val );
- if( attr_merge( e, ad_supportedSASLMechanisms, vals, NULL ) )
- {
+ if( attr_merge( e, ad_supportedSASLMechanisms, vals, NULL ) ) {
return LDAP_OTHER;
}
}
}
if ( default_referral != NULL ) {
- if( attr_merge( e, ad_ref, default_referral, NULL /* FIXME */ ) )
- {
+ if( attr_merge( e, ad_ref, default_referral, NULL /* FIXME */ ) ) {
return LDAP_OTHER;
}
}
Attribute *a;
for( a = usr_attr->e_attrs; a != NULL; a = a->a_next ) {
if( attr_merge( e, a->a_desc, a->a_vals,
- (a->a_nvals == a->a_vals) ? NULL : a->a_nvals ) )
+ (a->a_nvals == a->a_vals) ? NULL : a->a_nvals ) )
{
return LDAP_OTHER;
}
for(a = e->e_attrs; a != NULL; a = a->a_next) {
if( attr_merge( usr_attr, a->a_desc, a->a_vals,
- (a->a_nvals == a->a_vals) ? NULL : a->a_nvals ) )
+ (a->a_nvals == a->a_vals) ? NULL : a->a_nvals ) )
{
rc = LDAP_OTHER;
break;
/* must match in schema_init.c */
#define SLAPD_DN_SYNTAX "1.3.6.1.4.1.1466.115.121.1.12"
#define SLAPD_NAMEUID_SYNTAX "1.3.6.1.4.1.1466.115.121.1.34"
+#define SLAPD_INTEGER_SYNTAX "1.3.6.1.4.1.1466.115.121.1.27"
#define SLAPD_GROUP_ATTR "member"
#define SLAPD_GROUP_CLASS "groupOfNames"
#define SLAPD_ROLE_ATTR "roleOccupant"
#define SLAP_BFLAG_GLUE_INSTANCE 0x0010U /* a glue backend */
#define SLAP_BFLAG_GLUE_SUBORDINATE 0x0020U /* child of a glue hierarchy */
#define SLAP_BFLAG_GLUE_LINKED 0x0040U /* child is connected to parent */
-#define SLAP_BFLAG_ALIASES 0x0100U
-#define SLAP_BFLAG_REFERRALS 0x0200U
-#define SLAP_BFLAG_SUBENTRIES 0x0400U
-#define SLAP_BFLAG_MONITOR 0x1000U
-#define SLAP_BFLAG_DYNAMIC 0x2000U
+#define SLAP_BFLAG_MONITOR 0x0080U /* a monitor backend */
+#define SLAP_BFLAG_INCREMENT 0x0100U
+#define SLAP_BFLAG_ALIASES 0x1000U
+#define SLAP_BFLAG_REFERRALS 0x2000U
+#define SLAP_BFLAG_SUBENTRIES 0x4000U
+#define SLAP_BFLAG_DYNAMIC 0x8000U
slap_mask_t be_flags;
#define SLAP_LASTMOD(be) (!((be)->be_flags & SLAP_BFLAG_NOLASTMOD))
#define SLAP_GLUE_INSTANCE(be) ((be)->be_flags & SLAP_BFLAG_GLUE_INSTANCE)
#define SLAP_GLUE_SUBORDINATE(be) \
((be)->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE)
#define SLAP_GLUE_LINKED(be) ((be)->be_flags & SLAP_BFLAG_GLUE_LINKED)
+
+#define SLAP_MONITOR(be) ((be)->be_flags & SLAP_BFLAG_MONITOR)
+#define SLAP_INCREMENT(be) ((be)->be_flags & SLAP_BFLAG_INCREMENT)
+
#define SLAP_ALIASES(be) ((be)->be_flags & SLAP_BFLAG_ALIASES)
#define SLAP_REFERRALS(be) ((be)->be_flags & SLAP_BFLAG_REFERRALS)
#define SLAP_SUBENTRIES(be) ((be)->be_flags & SLAP_BFLAG_SUBENTRIES)
-#define SLAP_MONITOR(be) ((be)->be_flags & SLAP_BFLAG_MONITOR)
#define SLAP_DYNAMIC(be) ((be)->be_flags & SLAP_BFLAG_DYNAMIC)
+
slap_mask_t be_restrictops; /* restriction operations */
#define SLAP_RESTRICT_OP_ADD 0x0001U
#define SLAP_RESTRICT_OP_BIND 0x0002U
nvals = 0;
nops++;
break;
+ case T_MODOPINCREMENT:
+ state = T_MODOPINCREMENT;
+ ldmarr = ( LDAPMod ** )
+ ch_realloc(ldmarr, (( nops + 2 ) * ( sizeof( LDAPMod * ))));
+ ldmarr[ nops ] = ldm = alloc_ldapmod();
+ ldm->mod_op = LDAP_MOD_INCREMENT | LDAP_MOD_BVALUES;
+ ldm->mod_type = value;
+ nvals = 0;
+ nops++;
+ break;
default:
if ( state == AWAITING_OP ) {
#ifdef NEW_LOGGING
if ( !strcmp( type, T_MODOPDELETESTR )) {
return( T_MODOPDELETE );
}
+ if ( !strcmp( type, T_MODOPINCREMENTSTR )) {
+ return( T_MODOPINCREMENT );
+ }
return( T_ERR );
}
#define T_MODOPREPLACE 9
#define T_MODOPDELETESTR "delete"
#define T_MODOPDELETE 10
+#define T_MODOPINCREMENTSTR "increment"
+#define T_MODOPINCREMENT 11
#define T_MODSEPSTR "-"
-#define T_MODSEP 11
+#define T_MODSEP 12
#define T_NEWRDNSTR "newrdn"
#define T_DELOLDRDNSTR "deleteoldrdn"
dn: ou=People,o=University of Michigan,c=US
objectclass: organizationalUnit
+objectClass: extensibleObject
ou: People
+uidNumber: 0
+gidNumber: 0
dn: o=University of Michigan,c=US
objectclass: organization
dn: ou=People,o=University of Michigan,c=US
objectclass: organizationalUnit
+objectclass: extensibleObject
ou: People
+uidNumber: 1
+gidNumber: -1
dn: o=University of Michigan,c=US
objectclass: organization
dn: ou=People,o=University of Michigan,c=US
objectclass: organizationalUnit
+objectclass: extensibleObject
ou: People
+uidNumber: 0
+gidNumber: 0
dn: o=University of Michigan,c=US
objectclass: organization
dn: ou=People,o=University of Michigan,c=US
objectclass: organizationalUnit
+objectclass: extensibleObject
ou: People
+uidNumber: 0
+gidNumber: 0
dn: o=University of Michigan,c=US
objectclass: organization
dn: ou=People,o=University of Michigan,c=US
objectclass: organizationalUnit
+objectclass: extensibleObject
ou: People
+uidNumber: 0
+gidNumber: 0
dn: o=University of Michigan,c=US
objectclass: organization
dn: ou=People,o=University of Michigan,c=US
objectClass: organizationalUnit
+objectClass: extensibleObject
ou: People
+uidNumber: 0
+gidNumber: 0
dn: o=University of Michigan,c=US
objectClass: organization
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
pidfile ./test-db/slapd.pid
argsfile ./test-db/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
#
pidfile ./test-db/slapd.pid
argsfile ./test-db/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
pidfile ./test-db/slapd.pid
argsfile ./test-db/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
pidfile ./test-db/slapd.pid
argsfile ./test-db/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
pidfile ./test-db/slapd.pid
argsfile ./test-db/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
pidfile ./test-cache/slapd.pid
argsfile ./test-cache/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
pidfile ./test-db/slapd.pid
argsfile ./test-db/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
#
pidfile ./test-repl/slapd.pid
argsfile ./test-repl/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
pidfile ./test-db/slapd.pid
argsfile ./test-db/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
#
pidfile ./test-db/slapd.pid
argsfile ./test-db/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
#
pidfile ./test-repl/slapd.pid
argsfile ./test-repl/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
#
pidfile ./test-db/slapd.pid
argsfile ./test-db/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
#
pidfile ./test-repl/slapd.pid
argsfile ./test-repl/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
#
pidfile ./test-db/slapd.pid
argsfile ./test-db/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
#
pidfile ./test-repl/p1/slapd.pid
argsfile ./test-repl/p1/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
#
pidfile ./test-repl/p2/slapd.pid
argsfile ./test-repl/p2/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
#
pidfile ./test-repl/p3/slapd.pid
argsfile ./test-repl/p3/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
#
pidfile ./test-repl/r1/slapd.pid
argsfile ./test-repl/r1/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
#
pidfile ./test-repl/r2/slapd.pid
argsfile ./test-repl/r2/slapd.args
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
+include ./schema/nis.schema
pidfile ./test-db/slapd.pid
argsfile ./test-db/slapd.args
dn: ou=People,o=University of Michigan,c=US
objectClass: organizationalUnit
+objectClass: extensibleObject
ou: People
+uidNumber: 0
+gidNumber: 0
dn: ou=Alumni Association,ou=People,o=University of Michigan,c=US
objectClass: organizationalUnit
dn: ou=People,o=University of Michigan,c=US
objectclass: organizationalUnit
+objectclass: extensibleObject
ou: People
+uidNumber: 0
+gidNumber: 0
dn: ou=Groups,o=University of Michigan,c=US
objectclass: organizationalUnit
dn: ou=People,o=University of Michigan,c=US
objectclass: organizationalUnit
+objectclass: extensibleObject
ou: People
+uidNumber: 0
+gidNumber: 0
dn: o=University of Michigan,c=US
objectclass: organization
changetype: delete
# TRAILING COMMENT AND WHITE SPACE
+dn: ou=People,o=University of Michigan,c=US
+changetype: modify
+increment: uidNumber
+uidNumber: 1
+-
+increment: gidNumber
+gidNumber: -1
+
EOMODS
RC=$?