s/managedit/relax/

#unifdef -DSLAP_RELAX
This commit is contained in:
Kurt Zeilenga 2006-08-22 23:31:46 +00:00
parent 3d667a4705
commit d3e288dffe
16 changed files with 44 additions and 51 deletions

View File

@ -528,7 +528,8 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags );
#define SLAPI_X_CONN_SSF 1303 #define SLAPI_X_CONN_SSF 1303
#define SLAPI_X_CONN_SASL_CONTEXT 1304 #define SLAPI_X_CONN_SASL_CONTEXT 1304
#define SLAPI_X_OPERATION_DELETE_GLUE_PARENT 1305 #define SLAPI_X_OPERATION_DELETE_GLUE_PARENT 1305
#define SLAPI_X_MANAGEDIT 1306 #define SLAPI_X_RELAX 1306
#define SLAPI_X_MANAGEDIT SLAPI_X_RELAX
#define SLAPI_X_OPERATION_NO_SCHEMA_CHECK 1307 #define SLAPI_X_OPERATION_NO_SCHEMA_CHECK 1307
#define SLAPI_X_ADD_STRUCTURAL_CLASS 1308 #define SLAPI_X_ADD_STRUCTURAL_CLASS 1308
#define SLAPI_X_OPERATION_NO_SUBORDINATE_GLUE 1309 #define SLAPI_X_OPERATION_NO_SUBORDINATE_GLUE 1309

View File

@ -354,7 +354,7 @@ access_allowed_mask(
{ {
access = ACL_AUTH; access = ACL_AUTH;
} else if ( get_manageDIT( op ) && access_level == ACL_WRITE && } else if ( get_relax( op ) && access_level == ACL_WRITE &&
desc == slap_schema.si_ad_entry ) desc == slap_schema.si_ad_entry )
{ {
access = ACL_MANAGE; access = ACL_MANAGE;

View File

@ -97,7 +97,7 @@ txnReturn:
/* check entry's schema */ /* check entry's schema */
rs->sr_err = entry_schema_check( op, op->oq_add.rs_e, NULL, rs->sr_err = entry_schema_check( op, op->oq_add.rs_e, NULL,
get_manageDIT(op), &rs->sr_text, textbuf, textlen ); get_relax(op), &rs->sr_text, textbuf, textlen );
if ( rs->sr_err != LDAP_SUCCESS ) { if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, Debug( LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_add) ": entry failed schema check: " LDAP_XSTRING(bdb_add) ": entry failed schema check: "

View File

@ -205,7 +205,7 @@ int bdb_modify_internal(
} }
/* check that the entry still obeys the schema */ /* check that the entry still obeys the schema */
rc = entry_schema_check( op, e, save_attrs, get_manageDIT(op), rc = entry_schema_check( op, e, save_attrs, get_relax(op),
text, textbuf, textlen ); text, textbuf, textlen );
if ( rc != LDAP_SUCCESS || op->o_noop ) { if ( rc != LDAP_SUCCESS || op->o_noop ) {
attrs_free( e->e_attrs ); attrs_free( e->e_attrs );

View File

@ -71,7 +71,7 @@ ldap_back_add(
isupdate = be_shadow_update( op ); isupdate = be_shadow_update( op );
for ( i = 0, a = op->oq_add.rs_e->e_attrs; a; a = a->a_next ) { for ( i = 0, a = op->oq_add.rs_e->e_attrs; a; a = a->a_next ) {
if ( !isupdate && !get_manageDIT( op ) && a->a_desc->ad_type->sat_no_user_mod ) if ( !isupdate && !get_relax( op ) && a->a_desc->ad_type->sat_no_user_mod )
{ {
continue; continue;
} }

View File

@ -66,7 +66,7 @@ ldap_back_modify(
isupdate = be_shadow_update( op ); isupdate = be_shadow_update( op );
for ( i = 0, ml = op->oq_modify.rs_modlist; ml; ml = ml->sml_next ) { for ( i = 0, ml = op->oq_modify.rs_modlist; ml; ml = ml->sml_next ) {
if ( !isupdate && !get_manageDIT( op ) && ml->sml_desc->ad_type->sat_no_user_mod ) if ( !isupdate && !get_relax( op ) && ml->sml_desc->ad_type->sat_no_user_mod )
{ {
continue; continue;
} }

View File

@ -86,7 +86,7 @@ meta_back_add( Operation *op, SlapReply *rs )
for ( i = 0, a = op->ora_e->e_attrs; a; a = a->a_next ) { for ( i = 0, a = op->ora_e->e_attrs; a; a = a->a_next ) {
int j, is_oc = 0; int j, is_oc = 0;
if ( !isupdate && !get_manageDIT( op ) && a->a_desc->ad_type->sat_no_user_mod ) if ( !isupdate && !get_relax( op ) && a->a_desc->ad_type->sat_no_user_mod )
{ {
continue; continue;
} }

View File

@ -92,7 +92,7 @@ meta_back_modify( Operation *op, SlapReply *rs )
for ( i = 0, ml = op->orm_modlist; ml; ml = ml->sml_next ) { for ( i = 0, ml = op->orm_modlist; ml; ml = ml->sml_next ) {
int j, is_oc = 0; int j, is_oc = 0;
if ( !isupdate && !get_manageDIT( op ) && ml->sml_desc->ad_type->sat_no_user_mod ) if ( !isupdate && !get_relax( op ) && ml->sml_desc->ad_type->sat_no_user_mod )
{ {
continue; continue;
} }

View File

@ -867,10 +867,9 @@ backend_check_controls(
} }
} }
/* temporarily removed */ #if 0 /* temporarily removed */
#if 0
/* check should be generalized */ /* check should be generalized */
if( get_manageDIT(op) && !be_isroot(op)) { if( get_relax(op) && !be_isroot(op)) {
rs->sr_text = "requires manager authorization"; rs->sr_text = "requires manager authorization";
rs->sr_err = LDAP_UNWILLING_TO_PERFORM; rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
} }

View File

@ -25,27 +25,24 @@
#include "../../libraries/liblber/lber-int.h" #include "../../libraries/liblber/lber-int.h"
static SLAP_CTRL_PARSE_FN parseAssert; static SLAP_CTRL_PARSE_FN parseAssert;
static SLAP_CTRL_PARSE_FN parsePreRead; static SLAP_CTRL_PARSE_FN parseDomainScope;
static SLAP_CTRL_PARSE_FN parsePostRead;
static SLAP_CTRL_PARSE_FN parseProxyAuthz;
static SLAP_CTRL_PARSE_FN parseDontUseCopy; static SLAP_CTRL_PARSE_FN parseDontUseCopy;
#ifdef SLAP_RELAX
static SLAP_CTRL_PARSE_FN parseManageDIT;
#endif
static SLAP_CTRL_PARSE_FN parseManageDSAit; static SLAP_CTRL_PARSE_FN parseManageDSAit;
static SLAP_CTRL_PARSE_FN parseNoOp; static SLAP_CTRL_PARSE_FN parseNoOp;
static SLAP_CTRL_PARSE_FN parsePagedResults; static SLAP_CTRL_PARSE_FN parsePagedResults;
static SLAP_CTRL_PARSE_FN parsePermissiveModify;
static SLAP_CTRL_PARSE_FN parsePreRead, parsePostRead;
static SLAP_CTRL_PARSE_FN parseProxyAuthz;
static SLAP_CTRL_PARSE_FN parseRelax;
static SLAP_CTRL_PARSE_FN parseSearchOptions;
#ifdef SLAP_SORTEDRESULTS #ifdef SLAP_SORTEDRESULTS
static SLAP_CTRL_PARSE_FN parseSortedResults; static SLAP_CTRL_PARSE_FN parseSortedResults;
#endif #endif
static SLAP_CTRL_PARSE_FN parseValuesReturnFilter; static SLAP_CTRL_PARSE_FN parseSubentries;
static SLAP_CTRL_PARSE_FN parsePermissiveModify;
static SLAP_CTRL_PARSE_FN parseDomainScope;
#ifdef SLAP_CONTROL_X_TREE_DELETE #ifdef SLAP_CONTROL_X_TREE_DELETE
static SLAP_CTRL_PARSE_FN parseTreeDelete; static SLAP_CTRL_PARSE_FN parseTreeDelete;
#endif #endif
static SLAP_CTRL_PARSE_FN parseSearchOptions; static SLAP_CTRL_PARSE_FN parseValuesReturnFilter;
static SLAP_CTRL_PARSE_FN parseSubentries;
#undef sc_mask /* avoid conflict with Irix 6.5 <sys/signal.h> */ #undef sc_mask /* avoid conflict with Irix 6.5 <sys/signal.h> */
@ -177,13 +174,11 @@ static struct slap_control control_defs[] = {
SLAP_CTRL_ACCESS|SLAP_CTRL_HIDE, SLAP_CTRL_ACCESS|SLAP_CTRL_HIDE,
NULL, NULL, NULL, NULL,
parseNoOp, LDAP_SLIST_ENTRY_INITIALIZER(next) }, parseNoOp, LDAP_SLIST_ENTRY_INITIALIZER(next) },
#ifdef SLAP_RELAX
{ LDAP_CONTROL_RELAX, { LDAP_CONTROL_RELAX,
(int)offsetof(struct slap_control_ids, sc_manageDIT), (int)offsetof(struct slap_control_ids, sc_relax),
SLAP_CTRL_GLOBAL|SLAP_CTRL_UPDATE|SLAP_CTRL_HIDE, SLAP_CTRL_GLOBAL|SLAP_CTRL_UPDATE|SLAP_CTRL_HIDE,
NULL, NULL, NULL, NULL,
parseManageDIT, LDAP_SLIST_ENTRY_INITIALIZER(next) }, parseRelax, LDAP_SLIST_ENTRY_INITIALIZER(next) },
#endif
#ifdef LDAP_X_TXN #ifdef LDAP_X_TXN
{ LDAP_CONTROL_X_TXN_SPEC, { LDAP_CONTROL_X_TXN_SPEC,
(int)offsetof(struct slap_control_ids, sc_txnSpec), (int)offsetof(struct slap_control_ids, sc_txnSpec),
@ -868,13 +863,12 @@ static int parseDontUseCopy (
return LDAP_SUCCESS; return LDAP_SUCCESS;
} }
#ifdef SLAP_RELAX static int parseRelax (
static int parseManageDIT (
Operation *op, Operation *op,
SlapReply *rs, SlapReply *rs,
LDAPControl *ctrl ) LDAPControl *ctrl )
{ {
if ( op->o_managedit != SLAP_CONTROL_NONE ) { if ( op->o_relax != SLAP_CONTROL_NONE ) {
rs->sr_text = "relax control specified multiple times"; rs->sr_text = "relax control specified multiple times";
return LDAP_PROTOCOL_ERROR; return LDAP_PROTOCOL_ERROR;
} }
@ -884,13 +878,12 @@ static int parseManageDIT (
return LDAP_PROTOCOL_ERROR; return LDAP_PROTOCOL_ERROR;
} }
op->o_managedit = ctrl->ldctl_iscritical op->o_relax = ctrl->ldctl_iscritical
? SLAP_CONTROL_CRITICAL ? SLAP_CONTROL_CRITICAL
: SLAP_CONTROL_NONCRITICAL; : SLAP_CONTROL_NONCRITICAL;
return LDAP_SUCCESS; return LDAP_SUCCESS;
} }
#endif
static int parseManageDSAit ( static int parseManageDSAit (
Operation *op, Operation *op,

View File

@ -442,7 +442,7 @@ slap_mods_obsolete_check(
char *textbuf, char *textbuf,
size_t textlen ) size_t textlen )
{ {
if( get_manageDIT( op ) ) return LDAP_SUCCESS; if( get_relax( op ) ) return LDAP_SUCCESS;
for ( ; ml != NULL; ml = ml->sml_next ) { for ( ; ml != NULL; ml = ml->sml_next ) {
if ( is_at_obsolete( ml->sml_desc->ad_type ) && if ( is_at_obsolete( ml->sml_desc->ad_type ) &&
@ -481,7 +481,7 @@ slap_mods_no_user_mod_check(
continue; continue;
} }
if ( get_manageDIT( op ) ) { if ( get_relax( op ) ) {
if ( ml->sml_desc->ad_type->sat_flags & SLAP_AT_MANAGEABLE ) { if ( ml->sml_desc->ad_type->sat_flags & SLAP_AT_MANAGEABLE ) {
ml->sml_flags |= SLAP_MOD_MANAGING; ml->sml_flags |= SLAP_MOD_MANAGING;
continue; continue;

View File

@ -694,7 +694,7 @@ done:;
if ( rs->sr_err == LDAP_SUCCESS ) { if ( rs->sr_err == LDAP_SUCCESS ) {
int rc; int rc;
/* FIXME: this could be allowed when manageDIT is used... /* FIXME: this could be allowed when the Relax control is used...
* in that case: * in that case:
* *
* TODO * TODO
@ -713,7 +713,7 @@ done:;
rc = is_dynamicObject - was_dynamicObject; rc = is_dynamicObject - was_dynamicObject;
if ( rc ) { if ( rc ) {
#if 0 /* fix subordinate issues first */ #if 0 /* fix subordinate issues first */
if ( get_manageDIT( op ) ) { if ( get_relax( op ) ) {
switch ( rc ) { switch ( rc ) {
case -1: case -1:
/* need to delete entryTtl to have a consistent entry */ /* need to delete entryTtl to have a consistent entry */
@ -1077,7 +1077,7 @@ dds_op_extended( Operation *op, SlapReply *rs )
} }
/* we require manage privileges on the entryTtl, /* we require manage privileges on the entryTtl,
* and fake a manageDIT control */ * and fake a Relax control */
op2.o_tag = LDAP_REQ_MODIFY; op2.o_tag = LDAP_REQ_MODIFY;
op2.o_bd = &db; op2.o_bd = &db;
db.bd_info = (BackendInfo *)on->on_info; db.bd_info = (BackendInfo *)on->on_info;
@ -1085,7 +1085,7 @@ dds_op_extended( Operation *op, SlapReply *rs )
sc.sc_response = slap_replog_cb; sc.sc_response = slap_replog_cb;
sc.sc_next = &sc2; sc.sc_next = &sc2;
sc2.sc_response = slap_null_cb; sc2.sc_response = slap_null_cb;
op2.o_managedit = SLAP_CONTROL_CRITICAL; op2.o_relax = SLAP_CONTROL_CRITICAL;
op2.orm_modlist = &ttlmod; op2.orm_modlist = &ttlmod;
ttlmod.sml_op = LDAP_MOD_REPLACE; ttlmod.sml_op = LDAP_MOD_REPLACE;

View File

@ -122,7 +122,7 @@ static struct schema_info {
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 "
"SINGLE-VALUE " "SINGLE-VALUE "
#if 0 #if 0
/* Not until MANAGEDIT control is released */ /* Not until Relax control is released */
"NO-USER-MODIFICATION " "NO-USER-MODIFICATION "
#endif #endif
"USAGE directoryOperation )", "USAGE directoryOperation )",
@ -163,7 +163,7 @@ static struct schema_info {
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
"SINGLE-VALUE " "SINGLE-VALUE "
#if 0 #if 0
/* Not until MANAGEDIT control is released */ /* Not until Relax control is released */
"NO-USER-MODIFICATION " "NO-USER-MODIFICATION "
#endif #endif
"USAGE directoryOperation )", "USAGE directoryOperation )",

View File

@ -157,7 +157,7 @@ rwm_op_add( Operation *op, SlapReply *rs )
} }
} }
} else if ( !isupdate && !get_manageDIT( op ) && (*ap)->a_desc->ad_type->sat_no_user_mod ) } else if ( !isupdate && !get_relax( op ) && (*ap)->a_desc->ad_type->sat_no_user_mod )
{ {
goto next_attr; goto next_attr;
@ -441,7 +441,7 @@ rwm_op_modify( Operation *op, SlapReply *rs )
{ {
is_oc = 1; is_oc = 1;
} else if ( !isupdate && !get_manageDIT( op ) && (*mlp)->sml_desc->ad_type->sat_no_user_mod ) } else if ( !isupdate && !get_relax( op ) && (*mlp)->sml_desc->ad_type->sat_no_user_mod )
{ {
goto next_mod; goto next_mod;
@ -988,7 +988,7 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first, int stripEntryDN )
} }
} else if ( !isupdate } else if ( !isupdate
&& !get_manageDIT( op ) && !get_relax( op )
&& (*ap)->a_desc->ad_type->sat_no_user_mod && (*ap)->a_desc->ad_type->sat_no_user_mod
&& (*ap)->a_desc->ad_type != slap_schema.si_at_undefined ) && (*ap)->a_desc->ad_type != slap_schema.si_at_undefined )
{ {

View File

@ -2295,7 +2295,6 @@ struct slap_control_ids {
int sc_assert; int sc_assert;
int sc_domainScope; int sc_domainScope;
int sc_dontUseCopy; int sc_dontUseCopy;
int sc_manageDIT;
int sc_manageDSAit; int sc_manageDSAit;
int sc_modifyIncrement; int sc_modifyIncrement;
int sc_noOp; int sc_noOp;
@ -2304,6 +2303,7 @@ struct slap_control_ids {
int sc_postRead; int sc_postRead;
int sc_preRead; int sc_preRead;
int sc_proxyAuthz; int sc_proxyAuthz;
int sc_relax;
int sc_searchOptions; int sc_searchOptions;
#ifdef SLAP_SORTEDRESULTS #ifdef SLAP_SORTEDRESULTS
int sc_sortedResults; int sc_sortedResults;
@ -2466,8 +2466,8 @@ typedef struct slap_op {
#define o_dontUseCopy o_ctrlflag[slap_cids.sc_dontUseCopy] #define o_dontUseCopy o_ctrlflag[slap_cids.sc_dontUseCopy]
#define get_dontUseCopy(op) _SCM((op)->o_dontUseCopy) #define get_dontUseCopy(op) _SCM((op)->o_dontUseCopy)
#define o_managedit o_ctrlflag[slap_cids.sc_manageDIT] #define o_relax o_ctrlflag[slap_cids.sc_relax]
#define get_manageDIT(op) _SCM((op)->o_managedit) #define get_relax(op) _SCM((op)->o_relax)
#define o_managedsait o_ctrlflag[slap_cids.sc_manageDSAit] #define o_managedsait o_ctrlflag[slap_cids.sc_manageDSAit]
#define get_manageDSAit(op) _SCM((op)->o_managedsait) #define get_manageDSAit(op) _SCM((op)->o_managedsait)
@ -2775,7 +2775,7 @@ typedef struct slap_counters_t {
#define SLAP_CTRL_HIDE 0x80000000U #define SLAP_CTRL_HIDE 0x80000000U
#endif #endif
#define SLAP_CTRL_REQUIRES_ROOT 0x40000000U /* for ManageDIT */ #define SLAP_CTRL_REQUIRES_ROOT 0x40000000U /* for Relax */
#define SLAP_CTRL_GLOBAL 0x00800000U #define SLAP_CTRL_GLOBAL 0x00800000U
#define SLAP_CTRL_GLOBAL_SEARCH 0x00010000U /* for NOOP */ #define SLAP_CTRL_GLOBAL_SEARCH 0x00010000U /* for NOOP */

View File

@ -64,7 +64,7 @@ pblock_get_param_class( int param )
case SLAPI_DB2LDIF_PRINTKEY: case SLAPI_DB2LDIF_PRINTKEY:
case SLAPI_LDIF2DB_REMOVEDUPVALS: case SLAPI_LDIF2DB_REMOVEDUPVALS:
case SLAPI_MANAGEDSAIT: case SLAPI_MANAGEDSAIT:
case SLAPI_X_MANAGEDIT: case SLAPI_X_RELAX:
case SLAPI_X_OPERATION_NO_SCHEMA_CHECK: case SLAPI_X_OPERATION_NO_SCHEMA_CHECK:
case SLAPI_IS_REPLICATED_OPERATION: case SLAPI_IS_REPLICATED_OPERATION:
case SLAPI_X_CONN_IS_UDP: case SLAPI_X_CONN_IS_UDP:
@ -519,9 +519,9 @@ pblock_get( Slapi_PBlock *pb, int param, void **value )
PBLOCK_ASSERT_OP( pb, 0 ); PBLOCK_ASSERT_OP( pb, 0 );
*((int *)value) = get_manageDSAit( pb->pb_op ); *((int *)value) = get_manageDSAit( pb->pb_op );
break; break;
case SLAPI_X_MANAGEDIT: case SLAPI_X_RELAX:
PBLOCK_ASSERT_OP( pb, 0 ); PBLOCK_ASSERT_OP( pb, 0 );
*((int *)value) = get_manageDIT( pb->pb_op ); *((int *)value) = get_relax( pb->pb_op );
break; break;
case SLAPI_BACKEND: case SLAPI_BACKEND:
PBLOCK_ASSERT_OP( pb, 0 ); PBLOCK_ASSERT_OP( pb, 0 );
@ -924,9 +924,9 @@ pblock_set( Slapi_PBlock *pb, int param, void *value )
PBLOCK_ASSERT_OP( pb, 0 ); PBLOCK_ASSERT_OP( pb, 0 );
pb->pb_op->o_managedsait = *((int *)value); pb->pb_op->o_managedsait = *((int *)value);
break; break;
case SLAPI_X_MANAGEDIT: case SLAPI_X_RELAX:
PBLOCK_ASSERT_OP( pb, 0 ); PBLOCK_ASSERT_OP( pb, 0 );
pb->pb_op->o_managedit = *((int *)value); pb->pb_op->o_relax = *((int *)value);
break; break;
case SLAPI_BACKEND: case SLAPI_BACKEND:
PBLOCK_ASSERT_OP( pb, 0 ); PBLOCK_ASSERT_OP( pb, 0 );