mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-17 04:13:55 -05:00
merge sml_managing into sml_flags (SLAP_MOD_MANAGING)
This commit is contained in:
parent
9487629061
commit
e066ec210e
10 changed files with 7 additions and 39 deletions
|
|
@ -2312,7 +2312,7 @@ acl_check_modlist(
|
|||
* by the user
|
||||
*/
|
||||
if ( is_at_no_user_mod( mlist->sml_desc->ad_type )
|
||||
&& !mlist->sml_managing )
|
||||
&& ! ( mlist->sml_flags & SLAP_MOD_MANAGING ) )
|
||||
{
|
||||
Debug( LDAP_DEBUG_ACL, "acl: no-user-mod %s:"
|
||||
" modify access granted\n",
|
||||
|
|
@ -2329,7 +2329,7 @@ acl_check_modlist(
|
|||
*/
|
||||
if ( ! access_allowed( op, e,
|
||||
mlist->sml_desc, NULL,
|
||||
mlist->sml_managing ? ACL_MANAGE : ACL_WDEL,
|
||||
( mlist->sml_flags & SLAP_MOD_MANAGING ) ? ACL_MANAGE : ACL_WDEL,
|
||||
&state ) )
|
||||
{
|
||||
ret = 0;
|
||||
|
|
@ -2349,7 +2349,7 @@ acl_check_modlist(
|
|||
{
|
||||
if ( ! access_allowed( op, e,
|
||||
mlist->sml_desc, bv,
|
||||
mlist->sml_managing ? ACL_MANAGE : ACL_WADD,
|
||||
( mlist->sml_flags & SLAP_MOD_MANAGING ) ? ACL_MANAGE : ACL_WADD,
|
||||
&state ) )
|
||||
{
|
||||
ret = 0;
|
||||
|
|
@ -2362,7 +2362,7 @@ acl_check_modlist(
|
|||
if ( mlist->sml_values == NULL ) {
|
||||
if ( ! access_allowed( op, e,
|
||||
mlist->sml_desc, NULL,
|
||||
mlist->sml_managing ? ACL_MANAGE : ACL_WDEL,
|
||||
( mlist->sml_flags & SLAP_MOD_MANAGING ) ? ACL_MANAGE : ACL_WDEL,
|
||||
NULL ) )
|
||||
{
|
||||
ret = 0;
|
||||
|
|
@ -2376,7 +2376,7 @@ acl_check_modlist(
|
|||
{
|
||||
if ( ! access_allowed( op, e,
|
||||
mlist->sml_desc, bv,
|
||||
mlist->sml_managing ? ACL_MANAGE : ACL_WDEL,
|
||||
( mlist->sml_flags & SLAP_MOD_MANAGING ) ? ACL_MANAGE : ACL_WDEL,
|
||||
&state ) )
|
||||
{
|
||||
ret = 0;
|
||||
|
|
|
|||
|
|
@ -110,7 +110,6 @@ do_add( Operation *op, SlapReply *rs )
|
|||
}
|
||||
|
||||
mod = (Modifications *) ch_malloc( sizeof(Modifications) );
|
||||
mod->sml_managing = 0;
|
||||
mod->sml_op = LDAP_MOD_ADD;
|
||||
mod->sml_flags = 0;
|
||||
mod->sml_next = NULL;
|
||||
|
|
@ -578,7 +577,6 @@ slap_entry2mods(
|
|||
while ( a_new != NULL ) {
|
||||
a_new_desc = a_new->a_desc;
|
||||
mod = (Modifications *) malloc( sizeof( Modifications ));
|
||||
mod->sml_managing = 0;
|
||||
|
||||
mod->sml_op = LDAP_MOD_REPLACE;
|
||||
mod->sml_flags = 0;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,6 @@ do_modify(
|
|||
mod->sml_values = tmp.sml_values;
|
||||
mod->sml_nvalues = NULL;
|
||||
mod->sml_desc = NULL;
|
||||
mod->sml_managing = 0;
|
||||
mod->sml_next = NULL;
|
||||
*modtail = mod;
|
||||
|
||||
|
|
@ -502,7 +501,7 @@ slap_mods_no_user_mod_check(
|
|||
|
||||
if ( get_manageDIT( op ) ) {
|
||||
if ( ml->sml_desc->ad_type->sat_flags & SLAP_AT_MANAGEABLE ) {
|
||||
ml->sml_managing = 1;
|
||||
ml->sml_flags |= SLAP_MOD_MANAGING;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -884,7 +883,6 @@ int slap_mods_opattrs(
|
|||
if( rc != LDAP_SUCCESS ) return rc;
|
||||
|
||||
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
|
||||
mod->sml_managing = 0;
|
||||
mod->sml_op = mop;
|
||||
mod->sml_flags = SLAP_MOD_INTERNAL;
|
||||
BER_BVZERO( &mod->sml_type );
|
||||
|
|
@ -920,7 +918,6 @@ int slap_mods_opattrs(
|
|||
tmpval.bv_val = uuidbuf;
|
||||
|
||||
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
|
||||
mod->sml_managing = 0;
|
||||
mod->sml_op = mop;
|
||||
mod->sml_flags = SLAP_MOD_INTERNAL;
|
||||
BER_BVZERO( &mod->sml_type );
|
||||
|
|
@ -953,7 +950,6 @@ int slap_mods_opattrs(
|
|||
|
||||
if ( mod == *modtail ) {
|
||||
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
|
||||
mod->sml_managing = 0;
|
||||
mod->sml_op = mop;
|
||||
mod->sml_flags = SLAP_MOD_INTERNAL;
|
||||
BER_BVZERO( &mod->sml_type );
|
||||
|
|
@ -983,7 +979,6 @@ int slap_mods_opattrs(
|
|||
|
||||
if ( mod == *modtail ) {
|
||||
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
|
||||
mod->sml_managing = 0;
|
||||
mod->sml_op = mop;
|
||||
mod->sml_flags = SLAP_MOD_INTERNAL;
|
||||
BER_BVZERO( &mod->sml_type );
|
||||
|
|
@ -1002,7 +997,6 @@ int slap_mods_opattrs(
|
|||
|
||||
if ( SLAP_LASTMOD( op->o_bd ) ) {
|
||||
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
|
||||
mod->sml_managing = 0;
|
||||
mod->sml_op = mop;
|
||||
mod->sml_flags = SLAP_MOD_INTERNAL;
|
||||
BER_BVZERO( &mod->sml_type );
|
||||
|
|
@ -1026,7 +1020,6 @@ int slap_mods_opattrs(
|
|||
|
||||
if ( mod == *modtail ) {
|
||||
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
|
||||
mod->sml_managing = 0;
|
||||
mod->sml_op = mop;
|
||||
mod->sml_flags = SLAP_MOD_INTERNAL;
|
||||
BER_BVZERO( &mod->sml_type );
|
||||
|
|
@ -1055,7 +1048,6 @@ int slap_mods_opattrs(
|
|||
|
||||
if ( mod == *modtail ) {
|
||||
mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
|
||||
mod->sml_managing = 0;
|
||||
mod->sml_op = mop;
|
||||
mod->sml_flags = SLAP_MOD_INTERNAL;
|
||||
BER_BVZERO( &mod->sml_type );
|
||||
|
|
|
|||
|
|
@ -443,7 +443,6 @@ slap_modrdn2mods(
|
|||
}
|
||||
mod_tmp->sml_op = SLAP_MOD_SOFTADD;
|
||||
mod_tmp->sml_flags = SLAP_MOD_INTERNAL;
|
||||
mod_tmp->sml_managing = 0;
|
||||
mod_tmp->sml_next = mod;
|
||||
mod = mod_tmp;
|
||||
}
|
||||
|
|
@ -499,7 +498,6 @@ slap_modrdn2mods(
|
|||
}
|
||||
mod_tmp->sml_op = LDAP_MOD_DELETE;
|
||||
mod_tmp->sml_flags = SLAP_MOD_INTERNAL;
|
||||
mod_tmp->sml_managing = 0;
|
||||
mod_tmp->sml_next = mod;
|
||||
mod = mod_tmp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,7 +241,6 @@ account_locked( Operation *op, Entry *e,
|
|||
m->sml_flags = 0;
|
||||
m->sml_type = ad_pwdAccountLockedTime->ad_cname;
|
||||
m->sml_desc = ad_pwdAccountLockedTime;
|
||||
m->sml_managing = 0;
|
||||
m->sml_next = *mod;
|
||||
*mod = m;
|
||||
}
|
||||
|
|
@ -714,7 +713,6 @@ ppolicy_bind_resp( Operation *op, SlapReply *rs )
|
|||
m->sml_values = ch_calloc( sizeof(struct berval), 2 );
|
||||
|
||||
ber_dupbv( &m->sml_values[0], ×tamp );
|
||||
m->sml_managing = 0;
|
||||
m->sml_next = mod;
|
||||
mod = m;
|
||||
|
||||
|
|
@ -761,7 +759,6 @@ ppolicy_bind_resp( Operation *op, SlapReply *rs )
|
|||
m->sml_desc = ad_pwdAccountLockedTime;
|
||||
m->sml_values = ch_calloc( sizeof(struct berval), 2 );
|
||||
ber_dupbv( &m->sml_values[0], ×tamp );
|
||||
m->sml_managing = 0;
|
||||
m->sml_next = mod;
|
||||
mod = m;
|
||||
}
|
||||
|
|
@ -776,7 +773,6 @@ ppolicy_bind_resp( Operation *op, SlapReply *rs )
|
|||
m->sml_flags = 0;
|
||||
m->sml_type = ad_pwdFailureTime->ad_cname;
|
||||
m->sml_desc = ad_pwdFailureTime;
|
||||
m->sml_managing = 0;
|
||||
m->sml_next = mod;
|
||||
mod = m;
|
||||
}
|
||||
|
|
@ -865,7 +861,6 @@ grace:
|
|||
m->sml_desc = ad_pwdGraceUseTime;
|
||||
m->sml_values = ch_calloc( sizeof(struct berval), 2 );
|
||||
ber_dupbv( &m->sml_values[0], ×tamp );
|
||||
m->sml_managing = 0;
|
||||
m->sml_next = mod;
|
||||
mod = m;
|
||||
|
||||
|
|
@ -1306,7 +1301,6 @@ ppolicy_modify( Operation *op, SlapReply *rs )
|
|||
ml->sml_values[1].bv_len = 0;
|
||||
ml->sml_values[1].bv_val = NULL;
|
||||
ml->sml_nvalues = NULL;
|
||||
ml->sml_managing = 0;
|
||||
ml->sml_next = op->orm_modlist;
|
||||
op->orm_modlist = ml;
|
||||
delmod = ml;
|
||||
|
|
@ -1465,7 +1459,6 @@ do_modify:
|
|||
}
|
||||
mods->sml_flags = SLAP_MOD_INTERNAL;
|
||||
mods->sml_nvalues = NULL;
|
||||
mods->sml_managing = 0;
|
||||
mods->sml_next = NULL;
|
||||
modtail->sml_next = mods;
|
||||
modtail = mods;
|
||||
|
|
@ -1478,7 +1471,6 @@ do_modify:
|
|||
mods->sml_desc = ad_pwdGraceUseTime;
|
||||
mods->sml_values = NULL;
|
||||
mods->sml_nvalues = NULL;
|
||||
mods->sml_managing = 0;
|
||||
mods->sml_next = NULL;
|
||||
modtail->sml_next = mods;
|
||||
modtail = mods;
|
||||
|
|
@ -1493,7 +1485,6 @@ do_modify:
|
|||
mods->sml_desc = ad_pwdReset;
|
||||
mods->sml_values = NULL;
|
||||
mods->sml_nvalues = NULL;
|
||||
mods->sml_managing = 0;
|
||||
mods->sml_next = NULL;
|
||||
modtail->sml_next = mods;
|
||||
modtail = mods;
|
||||
|
|
@ -1532,7 +1523,6 @@ do_modify:
|
|||
mods->sml_values[i].bv_len = 0;
|
||||
ber_dupbv( &(mods->sml_values[i]), &p->bv );
|
||||
}
|
||||
mods->sml_managing = 0;
|
||||
mods->sml_next = NULL;
|
||||
modtail->sml_next = mods;
|
||||
modtail = mods;
|
||||
|
|
@ -1561,7 +1551,6 @@ do_modify:
|
|||
mods->sml_values[ 1 ].bv_val = NULL;
|
||||
mods->sml_values[ 1 ].bv_len = 0;
|
||||
make_pwd_history_value( timebuf, &mods->sml_values[0], pa );
|
||||
mods->sml_managing = 0;
|
||||
mods->sml_next = NULL;
|
||||
modtail->sml_next = mods;
|
||||
modtail = mods;
|
||||
|
|
|
|||
|
|
@ -294,7 +294,6 @@ refint_delete_cb(
|
|||
mp->sml_flags = 0;
|
||||
ber_dupbv(&mp->sml_values[0], &dd->nothing);
|
||||
ber_dupbv(&mp->sml_nvalues[0], &dd->nnothing);
|
||||
mp->sml_managing = 0;
|
||||
mp->sml_next = ma;
|
||||
ma = mp;
|
||||
}
|
||||
|
|
@ -310,7 +309,6 @@ refint_delete_cb(
|
|||
mp->sml_flags = 0;
|
||||
ber_dupbv(&mp->sml_values[0], &dd->dn);
|
||||
ber_dupbv(&mp->sml_nvalues[0], &mp->sml_values[0]);
|
||||
mp->sml_managing = 0;
|
||||
mp->sml_next = ma;
|
||||
ma = mp;
|
||||
Debug(LDAP_DEBUG_TRACE, "refint_delete_cb: %s: %s\n",
|
||||
|
|
@ -402,7 +400,6 @@ refint_modrdn_cb(
|
|||
ber_dupbv(&mp->sml_nvalues[0], &dd->nnewdn);
|
||||
mp->sml_values[1].bv_len = mp->sml_nvalues[1].bv_len = 0;
|
||||
mp->sml_values[1].bv_val = mp->sml_nvalues[1].bv_val = NULL;
|
||||
mp->sml_managing = 0;
|
||||
mp->sml_next = ip->mm;
|
||||
ip->mm = mp;
|
||||
mp = ch_malloc(sizeof(Modifications));
|
||||
|
|
@ -416,7 +413,6 @@ refint_modrdn_cb(
|
|||
ber_dupbv(&mp->sml_nvalues[0], &dd->dn);
|
||||
mp->sml_values[1].bv_len = mp->sml_nvalues[1].bv_len = 0;
|
||||
mp->sml_values[1].bv_val = mp->sml_nvalues[1].bv_val = NULL;
|
||||
mp->sml_managing = 0;
|
||||
mp->sml_next = ip->mm;
|
||||
ip->mm = mp;
|
||||
Debug(LDAP_DEBUG_TRACE, "refint_modrdn_cb: %s: %s\n",
|
||||
|
|
|
|||
|
|
@ -226,7 +226,6 @@ int passwd_extop(
|
|||
ml->sml_desc = slap_schema.si_ad_userPassword;
|
||||
ml->sml_op = LDAP_MOD_REPLACE;
|
||||
ml->sml_flags = 0;
|
||||
ml->sml_managing = 0;
|
||||
ml->sml_next = qpw->rs_mods;
|
||||
qpw->rs_mods = ml;
|
||||
|
||||
|
|
|
|||
|
|
@ -460,7 +460,6 @@ slap_auxprop_store(
|
|||
BER_BVZERO( &mod->sml_values[j] );
|
||||
mod->sml_nvalues = NULL;
|
||||
mod->sml_desc = NULL;
|
||||
mod->sml_managing = 0;
|
||||
*modtail = mod;
|
||||
modtail = &mod->sml_next;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1158,6 +1158,7 @@ typedef struct slap_mod {
|
|||
* running as non-root user, for user modifiable attributes.
|
||||
*/
|
||||
#define SLAP_MOD_INTERNAL 0x01
|
||||
#define SLAP_MOD_MANAGING 0x02
|
||||
|
||||
AttributeDescription *sm_desc;
|
||||
struct berval sm_type;
|
||||
|
|
@ -1173,7 +1174,6 @@ typedef struct slap_mod_list {
|
|||
#define sml_type sml_mod.sm_type
|
||||
#define sml_values sml_mod.sm_values
|
||||
#define sml_nvalues sml_mod.sm_nvalues
|
||||
char sml_managing;
|
||||
struct slap_mod_list *sml_next;
|
||||
} Modifications;
|
||||
|
||||
|
|
|
|||
|
|
@ -1102,7 +1102,6 @@ syncrepl_message_to_entry(
|
|||
mod->sml_type = tmp.sml_type;
|
||||
mod->sml_values = tmp.sml_values;
|
||||
mod->sml_nvalues = NULL;
|
||||
mod->sml_managing = 0;
|
||||
|
||||
*modtail = mod;
|
||||
modtail = &mod->sml_next;
|
||||
|
|
@ -1479,7 +1478,6 @@ retry_add:;
|
|||
mod->sml_type = mod->sml_desc->ad_cname;
|
||||
mod->sml_values = NULL;
|
||||
mod->sml_nvalues = NULL;
|
||||
mod->sml_managing = 0;
|
||||
if ( !modhead ) modhead = mod;
|
||||
if ( modtail ) {
|
||||
modtail->sml_next = mod;
|
||||
|
|
@ -1509,7 +1507,6 @@ retry_add:;
|
|||
ber_bvarray_add( &mod->sml_values, &uuid_bv );
|
||||
ber_dupbv( &uuid_bv, syncUUID );
|
||||
ber_bvarray_add( &mod->sml_nvalues, &uuid_bv );
|
||||
mod->sml_managing = 0;
|
||||
modtail->sml_next = mod;
|
||||
|
||||
op->o_tag = LDAP_REQ_MODIFY;
|
||||
|
|
|
|||
Loading…
Reference in a new issue