Connection *conn,
Operation *op,
Entry *e,
- LDAPModList *mlist
+ Modifications *mlist
)
{
int i;
* by ACL_WRITE checking as any found here are not provided
* by the user
*/
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ /* not yet implemented */
+#else
if ( oc_check_op_no_usermod_attr( mlist->ml_type ) ) {
Debug( LDAP_DEBUG_ACL, "NoUserMod Operational attribute:"
" modify access granted\n",
continue;
}
- switch ( mlist->ml_op & ~LDAP_MOD_BVALUES ) {
+ switch ( mlist->ml_op ) {
case LDAP_MOD_REPLACE:
case LDAP_MOD_ADD:
if ( mlist->ml_bvalues == NULL ) {
}
break;
}
+#endif
}
return( 1 );
extern int bdb2_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, char *ndn, LDAPModList *ml ));
+ char *dn, char *ndn, Modifications *ml ));
extern int bdb2_back_modrdn LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
*/
int bdb2i_index_add_entry LDAP_P(( BackendDB *be, Entry *e ));
-int bdb2i_index_add_mods LDAP_P(( BackendDB *be, LDAPModList *ml, ID id ));
+int bdb2i_index_add_mods LDAP_P(( BackendDB *be, Modifications *ml, ID id ));
ID_BLOCK * bdb2i_index_read LDAP_P(( BackendDB *be, char *type, int indextype, char *val ));
int bdb2i_index_add_values LDAP_P(( BackendDB *be, char *type, struct berval **vals, ID id ));
int bdb2i_delete_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
int bdb2i_replace_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
int bdb2i_back_modify_internal LDAP_P((Backend *be, Connection *conn, Operation *op,
- char *dn, LDAPModList *mods, Entry *e));
+ char *dn, Modifications *mods, Entry *e));
/*
* nextid.c
*/
Entry *e ));
void bdb2i_check_default_attr_index_mod LDAP_P((
struct ldbminfo *li,
- LDAPModList *modlist ));
+ Modifications *modlist ));
ID bdb2i_get_nextid LDAP_P(( BackendDB *be ));
int bdb2i_put_nextid LDAP_P(( BackendDB *be, ID id ));
LDBM bdb2i_db_open LDAP_P(( char *name, int type, int rw, int mode,
extern int ldap_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, char *ndn, LDAPModList *ml ));
+ char *dn, char *ndn, Modifications *ml ));
extern int ldap_back_modrdn LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
extern int ldbm_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, char *ndn, LDAPModList *ml ));
+ char *dn, char *ndn, Modifications *ml ));
extern int ldbm_back_modrdn LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
int
index_add_mods(
Backend *be,
- LDAPModList *ml,
+ Modifications *ml,
ID id
)
{
int rc;
for ( ; ml != NULL; ml = ml->ml_next ) {
- LDAPMod *mod = &ml->ml_mod;
+ Modification *mod = &ml->ml_mod;
- switch ( mod->mod_op & ~LDAP_MOD_BVALUES ) {
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ /* not yet implemented */
+ rc = -1;
+#else
+ switch ( mod->mod_op ) {
case LDAP_MOD_REPLACE:
/* XXX: Delete old index data==>problem when this
* gets called we lost values already!
id,
SLAP_INDEX_DELETE_OP );
break;
- case LDAP_MOD_SOFTADD: /* SOFTADD means index was there */
+ case SLAP_MOD_SOFTADD: /* SOFTADD means index was there */
rc = 0;
break;
+
+ default:
+ rc = -1;
}
+#endif
if ( rc != 0 ) {
return( rc );
Connection *conn,
Operation *op,
char *dn,
- LDAPModList *modlist,
+ Modifications *modlist,
Entry *e
)
{
int err;
LDAPMod *mod;
- LDAPModList *ml;
+ Modifications *ml;
Attribute *a;
Attribute *save_attrs;
for ( ml = modlist; ml != NULL; ml = ml->ml_next ) {
mod = &ml->ml_mod;
- switch ( mod->mod_op & ~LDAP_MOD_BVALUES ) {
+ switch ( mod->mod_op ) {
case LDAP_MOD_ADD:
err = add_values( e, mod, op->o_ndn );
break;
err = replace_values( e, mod, op->o_ndn );
break;
- case LDAP_MOD_SOFTADD:
+ case SLAP_MOD_SOFTADD:
/* Avoid problems in index_add_mods()
* We need to add index if necessary.
*/
== LDAP_TYPE_OR_VALUE_EXISTS ) {
err = LDAP_SUCCESS;
- mod->mod_op = LDAP_MOD_SOFTADD;
+ mod->mod_op = SLAP_MOD_SOFTADD;
}
break;
if( save_attrs != NULL ) {
for ( ml = modlist; ml != NULL; ml = ml->ml_next ) {
mod = &ml->ml_mod;
- if( ( mod->mod_op & ~LDAP_MOD_BVALUES )
- == LDAP_MOD_REPLACE )
- {
+ if ( mod->mod_op == LDAP_MOD_REPLACE ) {
/* Need to remove all values from indexes */
a = attr_find( save_attrs, mod->mod_type );
Operation *op,
char *dn,
char *ndn,
- LDAPModList *modlist
+ Modifications *modlist
)
{
int rc;
struct berval *add_bvals[2]; /* Stores new rdn att */
struct berval del_bv; /* Stores old rdn att */
struct berval *del_bvals[2]; /* Stores old rdn att */
- LDAPModList mod[2]; /* Used to delete old rdn */
+ Modifications mod[2]; /* Used to delete old rdn */
int manageDSAit = get_manageDSAit( op );
Debug( LDAP_DEBUG_TRACE, "==>ldbm_back_modrdn(newSuperior=%s)\n",
add_bv.bv_val = new_rdn_val;
add_bv.bv_len = strlen(new_rdn_val);
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ /* not yet implemented */
+#else
mod[0].ml_type = new_rdn_type;
mod[0].ml_bvalues = add_bvals;
- mod[0].ml_op = LDAP_MOD_SOFTADD;
+ mod[0].ml_op = SLAP_MOD_SOFTADD;
mod[0].ml_next = NULL;
+#endif
/* Remove old rdn value if required */
del_bv.bv_val = old_rdn_val;
del_bv.bv_len = strlen(old_rdn_val);
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ /* not yet implemented */
+#else
/* No need to normalize old_rdn_type, delete_values()
* does that for us
*/
mod[1].ml_bvalues = del_bvals;
mod[1].ml_op = LDAP_MOD_DELETE;
mod[1].ml_next = NULL;
+#endif
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: removing old_rdn_val=%s\n",
}
{
- LDAPModList ml;
+ Modifications ml;
struct berval *vals[2];
vals[0] = hash;
vals[1] = NULL;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ /* not yet implemented */
+#else
ml.ml_type = ch_strdup("userPassword");
ml.ml_bvalues = vals;
- ml.ml_op = LDAP_MOD_REPLACE | LDAP_MOD_BVALUES;
+ ml.ml_op = LDAP_MOD_REPLACE;
ml.ml_next = NULL;
+#endif
rc = ldbm_modify_internal( be,
conn, op, op->o_ndn, &ml, e );
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ /* not yet implemented */
+#else
ch_free(ml.ml_type);
+#endif
}
if( rc == LDAP_SUCCESS ) {
*/
int index_add_entry LDAP_P(( Backend *be, Entry *e ));
-int index_add_mods LDAP_P(( Backend *be, LDAPModList *ml, ID id ));
+int index_add_mods LDAP_P(( Backend *be, Modifications *ml, ID id ));
ID_BLOCK * index_read LDAP_P(( Backend *be,
char *type, int indextype, char *val ));
/* Possible operations supported (op) by index_change_values() */
/* returns LDAP error code indicating error OR SLAPD_ABANDON */
int ldbm_modify_internal LDAP_P((Backend *be,
Connection *conn, Operation *op,
- char *dn, LDAPModList *mods, Entry *e ));
+ char *dn, Modifications *mods, Entry *e ));
#ifdef HAVE_CYRUS_SASL
/*
extern int perl_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, char *ndn, LDAPModList *ml ));
+ char *dn, char *ndn, Modifications *ml ));
extern int perl_back_modrdn LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
extern int shell_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, char *ndn, LDAPModList *ml ));
+ char *dn, char *ndn, Modifications *ml ));
extern int shell_back_modrdn LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
extern int tcl_back_modify LDAP_P ((BackendDB * bd,
Connection * conn, Operation * op,
- char *dn, char *ndn, LDAPModList * ml));
+ char *dn, char *ndn, Modifications * ml));
extern int tcl_back_modrdn LDAP_P ((BackendDB * bd,
Connection * conn, Operation * op,
#include "ldap_pvt.h"
#include "slap.h"
-static void modlist_free(LDAPModList *ml);
+static void modlist_free(Modifications *ml);
-static int add_modified_attrs( Operation *op, LDAPModList **modlist );
+static int add_modified_attrs( Operation *op, Modifications **modlist );
int
do_modify(
char *last;
ber_tag_t tag;
ber_len_t len;
- LDAPModList *modlist = NULL;
- LDAPModList **modtail = &modlist;
+ Modifications *modlist = NULL;
+ Modifications **modtail = &modlist;
#ifdef LDAP_DEBUG
- LDAPModList *tmp;
+ Modifications *tmp;
#endif
Backend *be;
int rc;
{
ber_int_t mop;
- (*modtail) = (LDAPModList *) ch_calloc( 1, sizeof(LDAPModList) );
+ (*modtail) = (Modifications *) ch_calloc( 1, sizeof(Modifications) );
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ /* not yet implemented */
+#else
if ( ber_scanf( op->o_ber, "{i{a[V]}}", &mop,
&(*modtail)->ml_type, &(*modtail)->ml_bvalues )
== LBER_ERROR )
rc = -1;
goto cleanup;
}
+#endif
(*modtail)->ml_op = mop;
}
*modtail = NULL;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ /* not yet implemented */
+#else
#ifdef LDAP_DEBUG
Debug( LDAP_DEBUG_ARGS, "modifications:\n", 0, 0, 0 );
for ( tmp = modlist; tmp != NULL; tmp = tmp->ml_next ) {
? "add" : (tmp->ml_op == LDAP_MOD_DELETE
? "delete" : "replace"), tmp->ml_type, 0 );
}
+#endif
#endif
if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) {
}
static int
-add_modified_attrs( Operation *op, LDAPModList **modlist )
+add_modified_attrs( Operation *op, Modifications **modlist )
{
char buf[22];
struct berval bv;
struct berval *bvals[2];
- LDAPModList *m;
+ Modifications *m;
struct tm *ltm;
time_t currenttime;
bvals[0] = &bv;
bvals[1] = NULL;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ /* not yet implemented */
+#else
/* remove any attempts by the user to modify these attrs */
for ( m = *modlist; m != NULL; m = m->ml_next ) {
if ( oc_check_op_no_usermod_attr( m->ml_type ) ) {
bv.bv_val = op->o_dn;
bv.bv_len = strlen( bv.bv_val );
}
- m = (LDAPModList *) ch_calloc( 1, sizeof(LDAPModList) );
+ m = (Modifications *) ch_calloc( 1, sizeof(Modifications) );
m->ml_type = ch_strdup( "modifiersname" );
m->ml_op = LDAP_MOD_REPLACE;
m->ml_bvalues = (struct berval **) ch_calloc(2, sizeof(struct berval *));
bv.bv_val = buf;
bv.bv_len = strlen( bv.bv_val );
- m = (LDAPModList *) ch_calloc( 1, sizeof(LDAPModList) );
+ m = (Modifications *) ch_calloc( 1, sizeof(Modifications) );
m->ml_type = ch_strdup( "modifytimestamp" );
m->ml_op = LDAP_MOD_REPLACE;
m->ml_bvalues = (struct berval **) ch_calloc(2, sizeof(struct berval *));
m->ml_bvalues[0] = ber_bvdup( &bv );
m->ml_next = *modlist;
*modlist = m;
+#endif
return LDAP_SUCCESS;
}
static void
modlist_free(
- LDAPModList *ml
+ Modifications *ml
)
{
- LDAPModList *next;
+ Modifications *next;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ /* not yet implemented */
+#else
for ( ; ml != NULL; ml = next ) {
next = ml->ml_next;
free( ml );
}
+#endif
}
Connection *conn,
Operation *op,
Entry *e,
- LDAPModList *ml ));
+ Modifications *ml ));
LIBSLAPD_F (void) acl_append( AccessControl **l, AccessControl *a );
void *change
)
{
- LDAPModList *ml;
+ Modifications *ml;
Entry *e;
struct replog_moddn *moddn;
char *tmp;
fprintf( fp, "changetype: modify\n" );
ml = change;
for ( ; ml != NULL; ml = ml->ml_next ) {
- switch ( ml->ml_op & ~LDAP_MOD_BVALUES ) {
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ /* not yet implemented */
+#else
+ switch ( ml->ml_op ) {
case LDAP_MOD_ADD:
fprintf( fp, "add: %s\n", ml->ml_type );
break;
free( buf );
}
+#endif
fprintf( fp, "-\n" );
}
break;
* modrdn when the new rdn was already an attribute value itself.
* JCG 05/1999 (gomez@engr.sgi.com)
*/
-#define LDAP_MOD_SOFTADD 0x1000
+#define SLAP_MOD_SOFTADD 0x1000
+#undef LDAP_MOD_BVALUES
#define ON 1
#define OFF (-1)
void* e_private;
} Entry;
+/*
+ * A list of LDAPMods
+ */
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+typedef struct slap_mod {
+ int sm_op;
+ AttributeDescription sm_desc;
+ struct berval **sm_bvalues;
+} Modification;
+#else
+#define Modification LDAPMod
+#endif
+
+typedef struct slap_mod_list {
+ Modification ml_mod;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+#define ml_op ml_mod.sm_op
+#define ml_desc ml_mod.sm_desc
+#define ml_bvalues ml_mod.sm_bvalues
+#else
+#define ml_op ml_mod.mod_op
+#define ml_type ml_mod.mod_type
+#define ml_values ml_mod.mod_values
+#define ml_bvalues ml_mod.mod_bvalues
+#endif
+ struct slap_mod_list *ml_next;
+} Modifications;
+
/*
* represents an access control list
*/
} AccessControl;
/*
- * A list of LDAPMods
+ * replog moddn param structure
*/
-typedef struct ldapmodlist {
- struct ldapmod ml_mod;
- struct ldapmodlist *ml_next;
-#define ml_op ml_mod.mod_op
-#define ml_type ml_mod.mod_type
-#define ml_values ml_mod.mod_values
-#define ml_bvalues ml_mod.mod_bvalues
-} LDAPModList;
-
-
struct replog_moddn {
char *newrdn;
int deloldrdn;
#endif
int (*bi_op_modify) LDAP_P((BackendDB *bd,
struct slap_conn *c, struct slap_op *o,
- char *dn, char *ndn, LDAPModList *m));
+ char *dn, char *ndn, Modifications *m));
int (*bi_op_modrdn) LDAP_P((BackendDB *bd,
struct slap_conn *c, struct slap_op *o,
char *dn, char *ndn, char *newrdn, int deleteoldrdn,