BerValue dn; /* basedn in parent, */
BerValue nothing; /* the nothing value, if needed */
BerValue nnothing; /* normalized nothingness */
+ BerValue refint_dn; /* modifier's name */
+ BerValue refint_ndn; /* normalized modifier's name */
struct re_s *qtask;
refint_q *qhead;
refint_q *qtail;
enum {
REFINT_ATTRS = 1,
- REFINT_NOTHING
+ REFINT_NOTHING,
+ REFINT_MODIFIERSNAME
};
static ConfigDriver refint_cf_gen;
"( OLcfgOvAt:11.2 NAME 'olcRefintNothing' "
"DESC 'Replacement DN to supply when needed' "
"SYNTAX OMsDN SINGLE-VALUE )", NULL, NULL },
+ { "refint_modifiersName", "DN", 2, 2, 0,
+ ARG_DN|ARG_MAGIC|REFINT_MODIFIERSNAME, refint_cf_gen,
+ "( OLcfgOvAt:11.3 NAME 'olcRefintModifiersName' "
+ "DESC 'The DN to use as modifiersName' "
+ "SYNTAX OMsDN SINGLE-VALUE )", NULL, NULL },
{ NULL, NULL, 0, 0, 0, ARG_IGNORED }
};
"NAME 'olcRefintConfig' "
"DESC 'Referential integrity configuration' "
"SUP olcOverlayConfig "
- "MAY ( olcRefintAttribute $ olcRefintNothing ) )",
+ "MAY ( olcRefintAttribute "
+ "$ olcRefintNothing "
+ "$ olcRefintModifiersName "
+ ") )",
Cft_Overlay, refintcfg },
{ NULL, 0, NULL }
};
}
rc = 0;
break;
+ case REFINT_MODIFIERSNAME:
+ if ( !BER_BVISEMPTY( &dd->refint_dn )) {
+ rc = value_add_one( &c->rvalue_vals,
+ &dd->refint_dn );
+ if ( rc ) return rc;
+ rc = value_add_one( &c->rvalue_nvals,
+ &dd->refint_ndn );
+ return rc;
+ }
+ rc = 0;
+ break;
default:
abort ();
}
dd->nnothing.bv_len = 0;
rc = 0;
break;
+ case REFINT_MODIFIERSNAME:
+ if ( dd->refint_dn.bv_val )
+ ber_memfree ( dd->refint_dn.bv_val );
+ if ( dd->refint_ndn.bv_val )
+ ber_memfree ( dd->refint_ndn.bv_val );
+ dd->refint_dn.bv_len = 0;
+ dd->refint_ndn.bv_len = 0;
+ rc = 0;
+ break;
default:
abort ();
}
dd->nnothing = c->value_ndn;
rc = 0;
break;
+ case REFINT_MODIFIERSNAME:
+ if ( dd->refint_dn.bv_val )
+ ber_memfree ( dd->refint_dn.bv_val );
+ if ( dd->refint_ndn.bv_val )
+ ber_memfree ( dd->refint_ndn.bv_val );
+ dd->refint_dn = c->value_dn;
+ dd->refint_ndn = c->value_ndn;
+ rc = 0;
+ break;
default:
abort ();
}
return -1;
ber_dupbv( &id->dn, &be->be_nsuffix[0] );
}
+ if ( BER_BVISNULL( &id->refint_dn ) ) {
+ ber_dupbv( &id->refint_dn, &refint_dn );
+ ber_dupbv( &id->refint_ndn, &refint_ndn );
+ }
return(0);
}
BER_BVZERO( &id->nothing );
ch_free( id->nnothing.bv_val );
BER_BVZERO( &id->nnothing );
+ ch_free( id->refint_dn.bv_val );
+ BER_BVZERO( &id->refint_dn );
+ ch_free( id->refint_ndn.bv_val );
+ BER_BVZERO( &id->refint_ndn );
return(0);
}
m->sml_nvalues = m->sml_values+2;
BER_BVZERO( &m->sml_values[1] );
BER_BVZERO( &m->sml_nvalues[1] );
- m->sml_values[0] = refint_dn;
- m->sml_nvalues[0] = refint_ndn;
+ m->sml_values[0] = id->refint_dn;
+ m->sml_nvalues[0] = id->refint_ndn;
}
if ( !BER_BVISEMPTY( &rq->newdn ) || ( ra->next &&
ra->attr == ra->next->attr ) )