From b54780f940cb54c02067bf1767cd232748961c5f Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 7 Aug 2003 16:42:40 +0000 Subject: [PATCH] Add initial support for modify/increment. No over/under flow detection. 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)). --- include/ldap.h | 21 +++-- servers/slapd/back-bdb/init.c | 1 + servers/slapd/back-bdb/modify.c | 22 +++++ servers/slapd/back-ldbm/init.c | 1 + servers/slapd/back-ldbm/modify.c | 22 +++++ servers/slapd/backend.c | 4 +- servers/slapd/controls.c | 30 ++++++ servers/slapd/modify.c | 94 +++++++++++++++---- servers/slapd/mods.c | 85 +++++++++++++---- servers/slapd/proto-slap.h | 4 + servers/slapd/repl.c | 11 ++- servers/slapd/root_dse.c | 35 ++++--- servers/slapd/slap.h | 18 ++-- servers/slurpd/ldap_op.c | 13 +++ servers/slurpd/slurp.h | 4 +- tests/data/acl.out.master | 3 + tests/data/modify.out.master | 3 + tests/data/modrdn.out.master | 3 + tests/data/modrdn.out.master.0 | 3 + tests/data/search.out.master | 3 + tests/data/search.out.xsearch | 3 + tests/data/slapd-acl.conf | 1 + tests/data/slapd-cache-master.conf | 1 + tests/data/slapd-glue.conf | 1 + tests/data/slapd-master.conf | 1 + tests/data/slapd-passwd.conf | 1 + tests/data/slapd-proxycache.conf | 1 + tests/data/slapd-pw.conf | 1 + tests/data/slapd-ref-slave.conf | 1 + tests/data/slapd-referrals.conf | 1 + tests/data/slapd-repl-master.conf | 1 + tests/data/slapd-repl-slave.conf | 1 + tests/data/slapd-repl-submaster.conf | 1 + tests/data/slapd-repl-subslave.conf | 1 + tests/data/slapd-syncrepl-master.conf | 1 + tests/data/slapd-syncrepl-slave-persist1.conf | 1 + tests/data/slapd-syncrepl-slave-persist2.conf | 1 + tests/data/slapd-syncrepl-slave-persist3.conf | 1 + tests/data/slapd-syncrepl-slave-refresh1.conf | 1 + tests/data/slapd-syncrepl-slave-refresh2.conf | 1 + tests/data/slapd.conf | 1 + tests/data/test-glued.ldif | 3 + tests/data/test-ordered.ldif | 3 + tests/data/test.ldif | 3 + tests/scripts/test004-modify | 8 ++ 45 files changed, 347 insertions(+), 73 deletions(-) diff --git a/include/ldap.h b/include/ldap.h index 81194df71c..da0459ca66 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -181,15 +181,16 @@ typedef struct ldapcontrol { } 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" @@ -198,7 +199,7 @@ typedef struct ldapcontrol { #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 @@ -248,7 +249,7 @@ typedef struct ldapcontrol { #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 diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index f2d880ea48..0ab747ac7c 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -68,6 +68,7 @@ bdb_db_init( BackendDB *be ) /* indicate system schema supported */ be->be_flags |= + SLAP_BFLAG_INCREMENT | #ifdef BDB_SUBENTRIES SLAP_BFLAG_SUBENTRIES | #endif diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 6df4d5d71b..467c55936c 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -112,6 +112,28 @@ int bdb_modify_internal( } 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, diff --git a/servers/slapd/back-ldbm/init.c b/servers/slapd/back-ldbm/init.c index ca095eccfe..3797b2b60c 100644 --- a/servers/slapd/back-ldbm/init.c +++ b/servers/slapd/back-ldbm/init.c @@ -129,6 +129,7 @@ ldbm_back_db_init( /* indicate system schema supported */ be->be_flags |= + SLAP_BFLAG_INCREMENT | #ifdef LDBM_SUBENTRIES SLAP_BFLAG_SUBENTRIES | #endif diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index 1c6754b399..2448c6ad42 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -116,6 +116,28 @@ int ldbm_modify_internal( } 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, diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 590666032a..62e3957ea8 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -821,8 +821,8 @@ backend_check_controls( 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; diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 7137c03ae5..8a022a0dd4 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -22,6 +22,7 @@ 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; @@ -102,6 +103,9 @@ static struct slap_control control_defs[] = { 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) }, @@ -632,6 +636,32 @@ return_results: 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, diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 547e8c035c..bae64a9f7a 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -50,6 +50,7 @@ do_modify( 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 ); @@ -147,14 +148,53 @@ do_modify( 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 @@ -227,9 +267,10 @@ do_modify( 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 ); @@ -243,9 +284,10 @@ do_modify( #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", @@ -311,7 +353,7 @@ do_modify( 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; } @@ -327,6 +369,12 @@ do_modify( 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 ); @@ -399,7 +447,7 @@ do_modify( */ #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) @@ -572,7 +620,9 @@ int slap_mods_check( } 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, @@ -585,6 +635,22 @@ int slap_mods_check( 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 */ @@ -679,8 +745,6 @@ int slap_mods_check( ml->sml_nvalues[nvals].bv_val = NULL; ml->sml_nvalues[nvals].bv_len = 0; - - } else { } } } @@ -747,9 +811,7 @@ int slap_mods_opattrs( 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; diff --git a/servers/slapd/mods.c b/servers/slapd/mods.c index e097e44b8c..02d4bcb207 100644 --- a/servers/slapd/mods.c +++ b/servers/slapd/mods.c @@ -16,6 +16,8 @@ #include "portable.h" +#include + #include "slap.h" int @@ -40,8 +42,7 @@ modify_add_values( Modification *mod, int permissive, const char **text, - char *textbuf, size_t textlen -) + char *textbuf, size_t textlen ) { int i, j; int matched; @@ -176,8 +177,8 @@ modify_add_values( } 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; @@ -190,8 +191,7 @@ modify_add_values( } /* 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, @@ -263,8 +263,7 @@ modify_delete_values( 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 ) { @@ -312,7 +311,6 @@ modify_delete_values( break; } - if ( found == 0 ) { *text = textbuf; snprintf( textbuf, textlen, @@ -324,8 +322,7 @@ modify_delete_values( } /* 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 ); @@ -366,8 +363,7 @@ modify_replace_values( 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 ); @@ -378,11 +374,67 @@ modify_replace_values( 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; @@ -395,8 +447,7 @@ slap_mod_free( void slap_mods_free( - Modifications *ml -) + Modifications *ml ) { Modifications *next; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 621c7e69c3..0125d2f308 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -619,6 +619,10 @@ LDAP_SLAPD_F( int ) modify_replace_values( Entry *e, 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 ); diff --git a/servers/slapd/repl.c b/servers/slapd/repl.c index 77dbe9dafc..807cb8a92f 100644 --- a/servers/slapd/repl.c +++ b/servers/slapd/repl.c @@ -285,7 +285,9 @@ replog1( 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; } } @@ -302,9 +304,14 @@ replog1( 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; diff --git a/servers/slapd/root_dse.c b/servers/slapd/root_dse.c index 06f1ea12b2..0ff22bbaec 100644 --- a/servers/slapd/root_dse.c +++ b/servers/slapd/root_dse.c @@ -1,5 +1,5 @@ /* $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. @@ -25,11 +25,12 @@ #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} }; @@ -96,24 +97,24 @@ root_dse_info( 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; @@ -124,8 +125,7 @@ root_dse_info( 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; } } @@ -170,8 +170,7 @@ root_dse_info( 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; } } @@ -183,8 +182,7 @@ root_dse_info( 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; } } @@ -192,8 +190,7 @@ root_dse_info( } 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; } } @@ -202,7 +199,7 @@ root_dse_info( 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; } @@ -276,7 +273,7 @@ int read_root_dse_file( const char *fname ) 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; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 168dfe521c..8c72ab573d 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -141,6 +141,7 @@ LDAP_BEGIN_DECL /* 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" @@ -1395,23 +1396,28 @@ struct slap_backend_db { #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 diff --git a/servers/slurpd/ldap_op.c b/servers/slurpd/ldap_op.c index b3a8561b2a..f501a17cf0 100644 --- a/servers/slurpd/ldap_op.c +++ b/servers/slurpd/ldap_op.c @@ -331,6 +331,16 @@ op_ldap_modify( 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 @@ -696,6 +706,9 @@ char *type ) if ( !strcmp( type, T_MODOPDELETESTR )) { return( T_MODOPDELETE ); } + if ( !strcmp( type, T_MODOPINCREMENTSTR )) { + return( T_MODOPINCREMENT ); + } return( T_ERR ); } diff --git a/servers/slurpd/slurp.h b/servers/slurpd/slurp.h index d5884f1c2b..04db465f3e 100644 --- a/servers/slurpd/slurp.h +++ b/servers/slurpd/slurp.h @@ -117,8 +117,10 @@ #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" diff --git a/tests/data/acl.out.master b/tests/data/acl.out.master index 1b7d849b06..430f4422df 100644 --- a/tests/data/acl.out.master +++ b/tests/data/acl.out.master @@ -178,7 +178,10 @@ description: Manager of the directory 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 diff --git a/tests/data/modify.out.master b/tests/data/modify.out.master index 8e348a429c..d66f9df2cc 100644 --- a/tests/data/modify.out.master +++ b/tests/data/modify.out.master @@ -230,7 +230,10 @@ telephonenumber: +1 313 555 4177 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 diff --git a/tests/data/modrdn.out.master b/tests/data/modrdn.out.master index eb83c1c3c0..9105cb3815 100644 --- a/tests/data/modrdn.out.master +++ b/tests/data/modrdn.out.master @@ -253,7 +253,10 @@ telephonenumber: +1 313 555 4177 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 diff --git a/tests/data/modrdn.out.master.0 b/tests/data/modrdn.out.master.0 index e5ffa8e9cd..e219831639 100644 --- a/tests/data/modrdn.out.master.0 +++ b/tests/data/modrdn.out.master.0 @@ -251,7 +251,10 @@ telephonenumber: +1 313 555 4177 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 diff --git a/tests/data/search.out.master b/tests/data/search.out.master index 7e409424da..fed8b0c806 100644 --- a/tests/data/search.out.master +++ b/tests/data/search.out.master @@ -246,7 +246,10 @@ userPassword:: c2VjcmV0 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 diff --git a/tests/data/search.out.xsearch b/tests/data/search.out.xsearch index ddb5fe8409..83f0c5cde3 100644 --- a/tests/data/search.out.xsearch +++ b/tests/data/search.out.xsearch @@ -250,7 +250,10 @@ telephoneNumber: +1 313 555 4177 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 diff --git a/tests/data/slapd-acl.conf b/tests/data/slapd-acl.conf index dfc247fac1..0eee54cdec 100644 --- a/tests/data/slapd-acl.conf +++ b/tests/data/slapd-acl.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-cache-master.conf b/tests/data/slapd-cache-master.conf index 3dad68c4a9..c6721fcf42 100644 --- a/tests/data/slapd-cache-master.conf +++ b/tests/data/slapd-cache-master.conf @@ -6,6 +6,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-glue.conf b/tests/data/slapd-glue.conf index 257f75f7e1..e3979d0833 100644 --- a/tests/data/slapd-glue.conf +++ b/tests/data/slapd-glue.conf @@ -8,6 +8,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-master.conf b/tests/data/slapd-master.conf index a11c45afde..f11a4013fe 100644 --- a/tests/data/slapd-master.conf +++ b/tests/data/slapd-master.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-passwd.conf b/tests/data/slapd-passwd.conf index d6e2dadcb4..ac3dc41071 100644 --- a/tests/data/slapd-passwd.conf +++ b/tests/data/slapd-passwd.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-proxycache.conf b/tests/data/slapd-proxycache.conf index 0afe6cb9f6..3a106ca08c 100644 --- a/tests/data/slapd-proxycache.conf +++ b/tests/data/slapd-proxycache.conf @@ -6,6 +6,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-pw.conf b/tests/data/slapd-pw.conf index 8fb5b873e5..2c6dd41666 100644 --- a/tests/data/slapd-pw.conf +++ b/tests/data/slapd-pw.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-ref-slave.conf b/tests/data/slapd-ref-slave.conf index 109c763208..c4ae949fdd 100644 --- a/tests/data/slapd-ref-slave.conf +++ b/tests/data/slapd-ref-slave.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-referrals.conf b/tests/data/slapd-referrals.conf index a523cc030c..ed0fb9db32 100644 --- a/tests/data/slapd-referrals.conf +++ b/tests/data/slapd-referrals.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-repl-master.conf b/tests/data/slapd-repl-master.conf index 0123ae6a38..f2afea37f1 100644 --- a/tests/data/slapd-repl-master.conf +++ b/tests/data/slapd-repl-master.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-repl-slave.conf b/tests/data/slapd-repl-slave.conf index 18c6e1c4e6..569faabb98 100644 --- a/tests/data/slapd-repl-slave.conf +++ b/tests/data/slapd-repl-slave.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-repl-submaster.conf b/tests/data/slapd-repl-submaster.conf index f7598665c6..a2d44a5946 100644 --- a/tests/data/slapd-repl-submaster.conf +++ b/tests/data/slapd-repl-submaster.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-repl-subslave.conf b/tests/data/slapd-repl-subslave.conf index c6ba42f792..b67ad30404 100644 --- a/tests/data/slapd-repl-subslave.conf +++ b/tests/data/slapd-repl-subslave.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-syncrepl-master.conf b/tests/data/slapd-syncrepl-master.conf index 5cc86cb82f..e9e2b286fd 100644 --- a/tests/data/slapd-syncrepl-master.conf +++ b/tests/data/slapd-syncrepl-master.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-syncrepl-slave-persist1.conf b/tests/data/slapd-syncrepl-slave-persist1.conf index 7451d23cd7..ff78f84067 100644 --- a/tests/data/slapd-syncrepl-slave-persist1.conf +++ b/tests/data/slapd-syncrepl-slave-persist1.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-syncrepl-slave-persist2.conf b/tests/data/slapd-syncrepl-slave-persist2.conf index 1a949c2b76..bab32b0d85 100644 --- a/tests/data/slapd-syncrepl-slave-persist2.conf +++ b/tests/data/slapd-syncrepl-slave-persist2.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-syncrepl-slave-persist3.conf b/tests/data/slapd-syncrepl-slave-persist3.conf index d24815a1c4..b3dbd61c89 100644 --- a/tests/data/slapd-syncrepl-slave-persist3.conf +++ b/tests/data/slapd-syncrepl-slave-persist3.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-syncrepl-slave-refresh1.conf b/tests/data/slapd-syncrepl-slave-refresh1.conf index d2310e6034..fdb41f096f 100644 --- a/tests/data/slapd-syncrepl-slave-refresh1.conf +++ b/tests/data/slapd-syncrepl-slave-refresh1.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd-syncrepl-slave-refresh2.conf b/tests/data/slapd-syncrepl-slave-refresh2.conf index 199d5c384e..a6bdc14a27 100644 --- a/tests/data/slapd-syncrepl-slave-refresh2.conf +++ b/tests/data/slapd-syncrepl-slave-refresh2.conf @@ -7,6 +7,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/slapd.conf b/tests/data/slapd.conf index 5d6f39169c..5942610de9 100644 --- a/tests/data/slapd.conf +++ b/tests/data/slapd.conf @@ -8,6 +8,7 @@ include ./schema/core.schema 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 diff --git a/tests/data/test-glued.ldif b/tests/data/test-glued.ldif index b0f4af64e0..356c3305f2 100644 --- a/tests/data/test-glued.ldif +++ b/tests/data/test-glued.ldif @@ -16,7 +16,10 @@ associatedDomain: example.com 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 diff --git a/tests/data/test-ordered.ldif b/tests/data/test-ordered.ldif index a6893b6fe0..b2d329e335 100644 --- a/tests/data/test-ordered.ldif +++ b/tests/data/test-ordered.ldif @@ -18,7 +18,10 @@ associateddomain: example.com 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 diff --git a/tests/data/test.ldif b/tests/data/test.ldif index 17c6f4f3ee..7b4961f593 100644 --- a/tests/data/test.ldif +++ b/tests/data/test.ldif @@ -252,7 +252,10 @@ telephonenumber: +1 313 555 4177 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 diff --git a/tests/scripts/test004-modify b/tests/scripts/test004-modify index fdc1c5fe95..8a46a4a60d 100755 --- a/tests/scripts/test004-modify +++ b/tests/scripts/test004-modify @@ -129,6 +129,14 @@ dn: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=University 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=$? -- 2.39.5