ctrls[num_ctrls] = 0;
/* check entry's schema */
- rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e,
- NULL, &rs->sr_text, textbuf, textlen );
+ rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e, NULL, 0,
+ &rs->sr_text, textbuf, textlen );
if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_add) ": entry failed schema check: "
}
Debug( LDAP_DEBUG_TRACE,
- LDAP_XSTRING(bdb_add) ": no write access "
- "to parent\n", 0, 0, 0 );
+ LDAP_XSTRING(bdb_add) ": no write access to parent\n",
+ 0, 0, 0 );
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
rs->sr_text = "no write access to parent";
goto return_results;;
static char *controls[] = {
LDAP_CONTROL_ASSERT,
LDAP_CONTROL_MANAGEDSAIT,
+ LDAP_CONTROL_MANAGEDIT,
LDAP_CONTROL_NOOP,
LDAP_CONTROL_PAGEDRESULTS,
#ifdef LDAP_CONTROL_SUBENTRIES
Attribute *save_attrs;
Attribute *ap;
int glue_attr_delete = 0;
+ int manage=0;
Debug( LDAP_DEBUG_TRACE, "bdb_modify_internal: 0x%08lx: %s\n",
e->e_id, e->e_dn, 0);
+ if( get_manageDIT(op) ) {
+ AttributeDescription *entry = slap_schema.si_ad_entry;
+ if( !access_allowed( op, e, entry, NULL, ACL_MANAGE, NULL )) {
+ *text = "not authorized to manage entry";
+ return LDAP_INSUFFICIENT_ACCESS;
+ }
+
+ manage = 1;
+ }
+
if ( !acl_check_modlist( op, e, modlist )) {
return LDAP_INSUFFICIENT_ACCESS;
}
}
/* check that the entry still obeys the schema */
- rc = entry_schema_check( op->o_bd, e, save_attrs, text, textbuf, textlen );
+ rc = entry_schema_check( op->o_bd, e, save_attrs, manage,
+ text, textbuf, textlen );
if ( rc != LDAP_SUCCESS || op->o_noop ) {
attrs_free( e->e_attrs );
/* clear the indexing flags */
Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n",
op->o_req_dn.bv_val, 0, 0);
- rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e, NULL,
+ rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e, NULL, 0,
&rs->sr_text, textbuf, textlen );
if ( rs->sr_err != LDAP_SUCCESS ) {
}
/* check that the entry still obeys the schema */
- rc = entry_schema_check( op->o_bd, e, save_attrs, text, textbuf, textlen );
-
+ rc = entry_schema_check( op->o_bd, e, save_attrs, 0,
+ text, textbuf, textlen );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY, "entry failed schema check: %s\n",
*text, 0, 0 );
entry->e_ocflags = 0;
}
/* check that the entry still obeys the schema */
- rc = entry_schema_check(op->o_bd, entry, NULL,
- &rs->sr_text, textbuf, sizeof( textbuf ) );
+ rc = entry_schema_check(op->o_bd, entry, NULL, 0,
+ &rs->sr_text, textbuf, sizeof( textbuf ) );
}
return rc;
}
int statres;
char textbuf[SLAP_TEXT_BUFLEN];
- rs->sr_err = entry_schema_check(op->o_bd, e,
- NULL, &rs->sr_text, textbuf, sizeof( textbuf ) );
+ rs->sr_err = entry_schema_check(op->o_bd, e, NULL, 0,
+ &rs->sr_text, textbuf, sizeof( textbuf ) );
if ( rs->sr_err != LDAP_SUCCESS ) goto send_res;
ldap_pvt_thread_mutex_lock(&ni->li_mutex);
}
/* check that the entry still obeys the schema */
- rc = entry_schema_check( be_monitor, e, save_attrs,
- &text, textbuf, sizeof( textbuf ) );
+ rc = entry_schema_check( be_monitor, e, save_attrs, 0,
+ &text, textbuf, sizeof( textbuf ) );
if ( rc != LDAP_SUCCESS ) {
rs->sr_err = rc;
goto cleanup;
if ( BACKSQL_CHECK_SCHEMA( bi ) ) {
char textbuf[ SLAP_TEXT_BUFLEN ] = { '\0' };
- rs->sr_err = entry_schema_check( op->o_bd, op->ora_e,
- NULL,
- &rs->sr_text, textbuf, sizeof( textbuf ) );
+ rs->sr_err = entry_schema_check( op->o_bd, op->ora_e, NULL, 0,
+ &rs->sr_text, textbuf, sizeof( textbuf ) );
if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): "
"entry failed schema check -- aborting\n",
goto do_transact;
}
- rs->sr_err = entry_schema_check( op->o_bd, &m,
- NULL,
- &rs->sr_text, textbuf, sizeof( textbuf ) );
+ rs->sr_err = entry_schema_check( op->o_bd, &m, NULL, 0,
+ &rs->sr_text, textbuf, sizeof( textbuf ) );
if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): "
"entry failed schema check -- aborting\n",
e_id = bsi.bsi_base_id;
- rs->sr_err = entry_schema_check( op->o_bd, &r,
- NULL,
- &rs->sr_text, textbuf, sizeof( textbuf ) );
+ rs->sr_err = entry_schema_check( op->o_bd, &r, NULL, 0,
+ &rs->sr_text, textbuf, sizeof( textbuf ) );
if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): "
"entry failed schema check -- aborting\n",
if(rc == LDAP_SUCCESS) {
/* check that the entry still obeys the schema */
- rc = entry_schema_check(op->o_bd, e, NULL,
- &rs->sr_text, ca->msg, sizeof(ca->msg) );
+ rc = entry_schema_check(op->o_bd, e, NULL, 0,
+ &rs->sr_text, ca->msg, sizeof(ca->msg) );
}
if ( rc == LDAP_SUCCESS ) {
/* Basic syntax checks are OK. Do the actual settings. */
}
rs->sr_err = slap_mods_check( modlist, &rs->sr_text,
- textbuf, textlen, NULL );
+ textbuf, textlen, NULL );
if ( rs->sr_err != LDAP_SUCCESS ) {
send_ldap_result( op, rs );
}
}
-
-
if ( !repl_user ) {
for( modtail = &modlist;
*modtail != NULL;
char *textbuf, size_t textlen );
LDAP_SLAPD_F( int ) entry_schema_check(
- Backend *be, Entry *e, Attribute *attrs,
+ Backend *be,
+ Entry *e,
+ Attribute *attrs,
+ int manage,
const char** text,
char *textbuf, size_t textlen );
static int entry_naming_check(
Entry *e,
+ int manage,
const char** text,
char *textbuf, size_t textlen );
/*
Backend *be,
Entry *e,
Attribute *oldattrs,
+ int manage,
const char** text,
char *textbuf, size_t textlen )
{
return LDAP_OTHER;
}
- if( sc->soc_obsolete ) {
+ if( !manage && sc->soc_obsolete ) {
snprintf( textbuf, textlen,
"structuralObjectClass '%s' is OBSOLETE",
asc->a_vals[0].bv_val );
/* naming check */
if ( !is_entry_objectclass ( e, slap_schema.si_oc_glue, 0 ) ) {
- rc = entry_naming_check( e, text, textbuf, textlen );
+ rc = entry_naming_check( e, manage, text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
return rc;
}
/* check that the entry has required attrs of the content rule */
if( cr ) {
- if( cr->scr_obsolete ) {
+ if( !manage && cr->scr_obsolete ) {
snprintf( textbuf, textlen,
"content rule '%s' is obsolete",
ldap_contentrule2name( &cr->scr_crule ));
return LDAP_OBJECT_CLASS_VIOLATION;
}
- if ( oc->soc_obsolete ) {
+ if ( !manage && oc->soc_obsolete ) {
/* disallow obsolete classes */
snprintf( textbuf, textlen,
"objectClass '%s' is OBSOLETE",
static int
entry_naming_check(
Entry *e,
+ int manage,
const char** text,
char *textbuf, size_t textlen )
{
break;
}
- if( desc->ad_type->sat_obsolete ) {
+ if( !manage && desc->ad_type->sat_obsolete ) {
snprintf( textbuf, textlen,
"naming attribute '%s' is obsolete",
ava->la_attr.bv_val );
char textbuf[SLAP_TEXT_BUFLEN] = { '\0' };
size_t textlen = sizeof textbuf;
const char *progname = "slapadd";
+ int manage = 0;
struct berval csn;
struct berval maxcsn;
}
/* check schema */
- rc = entry_schema_check( be, e, NULL, &text, textbuf, textlen );
+ rc = entry_schema_check( be, e, NULL, manage,
+ &text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
fprintf( stderr, "%s: dn=\"%s\" (line=%d): (%d) %s\n",
if ( slapi_pblock_get( pb, SLAPI_BACKEND, (void **)&be ) != 0 )
return -1;
- rc = entry_schema_check( be, e, NULL, &text, textbuf, textlen );
+ rc = entry_schema_check( be, e, NULL, 0,
+ &text, textbuf, textlen );
return ( rc == LDAP_SUCCESS ) ? 0 : 1;
#else