- oc = attrs->an_oc;
- if( oc == NULL && attrs->an_name.bv_val ) {
- switch( attrs->an_name.bv_val[0] ) {
- case '@': /* @objectClass */
- case '+': /* +objectClass (deprecated) */
- case '!': { /* exclude */
- struct berval ocname;
- ocname.bv_len = attrs->an_name.bv_len - 1;
- ocname.bv_val = &attrs->an_name.bv_val[1];
- oc = oc_bvfind( &ocname );
- attrs->an_oc_exclude = 0;
- if ( oc && attrs->an_name.bv_val[0] == '!' ) {
- attrs->an_oc_exclude = 1;
- }
- } break;
+ if ( !( attrs->an_flags & SLAP_AN_OCINITED )) {
+ if( attrs->an_name.bv_val ) {
+ switch( attrs->an_name.bv_val[0] ) {
+ case '@': /* @objectClass */
+ case '+': /* +objectClass (deprecated) */
+ case '!': { /* exclude */
+ struct berval ocname;
+ ocname.bv_len = attrs->an_name.bv_len - 1;
+ ocname.bv_val = &attrs->an_name.bv_val[1];
+ oc = oc_bvfind( &ocname );
+ if ( oc && attrs->an_name.bv_val[0] == '!' ) {
+ attrs->an_flags |= SLAP_AN_OCEXCLUDE;
+ } else {
+ attrs->an_flags &= ~SLAP_AN_OCEXCLUDE;
+ }
+ } break;