1
1
/* ad.c - routines for dealing with attribute descriptions */
2
/* $OpenLDAP: pkg/ldap/servers/slapd/ad.c,v 1.95.2.8 2009/02/17 19:14:41 quanah Exp $ */
2
/* $OpenLDAP: pkg/ldap/servers/slapd/ad.c,v 1.95.2.9 2009/07/27 20:19:18 quanah Exp $ */
3
3
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5
5
* Copyright 1998-2009 The OpenLDAP Foundation.
594
594
* else if requested description is !objectClass, return
595
595
* attributes which the class does not require/allow
597
if ( !( attrs->an_flags & SLAP_AN_OCINITED )) {
598
if( attrs->an_name.bv_val ) {
599
switch( attrs->an_name.bv_val[0] ) {
600
case '@': /* @objectClass */
601
case '+': /* +objectClass (deprecated) */
602
case '!': { /* exclude */
603
struct berval ocname;
604
ocname.bv_len = attrs->an_name.bv_len - 1;
605
ocname.bv_val = &attrs->an_name.bv_val[1];
606
oc = oc_bvfind( &ocname );
607
if ( oc && attrs->an_name.bv_val[0] == '!' ) {
608
attrs->an_flags |= SLAP_AN_OCEXCLUDE;
610
attrs->an_flags &= ~SLAP_AN_OCEXCLUDE;
614
default: /* old (deprecated) way */
615
oc = oc_bvfind( &attrs->an_name );
619
attrs->an_flags |= SLAP_AN_OCINITED;
597
621
oc = attrs->an_oc;
598
if( oc == NULL && attrs->an_name.bv_val ) {
599
switch( attrs->an_name.bv_val[0] ) {
600
case '@': /* @objectClass */
601
case '+': /* +objectClass (deprecated) */
602
case '!': { /* exclude */
603
struct berval ocname;
604
ocname.bv_len = attrs->an_name.bv_len - 1;
605
ocname.bv_val = &attrs->an_name.bv_val[1];
606
oc = oc_bvfind( &ocname );
607
attrs->an_oc_exclude = 0;
608
if ( oc && attrs->an_name.bv_val[0] == '!' ) {
609
attrs->an_oc_exclude = 1;
613
default: /* old (deprecated) way */
614
oc = oc_bvfind( &attrs->an_name );
618
622
if( oc != NULL ) {
619
if ( attrs->an_oc_exclude ) {
623
if ( attrs->an_flags & SLAP_AN_OCEXCLUDE ) {
620
624
if ( oc == slap_schema.si_oc_extensibleObject ) {
621
625
/* extensibleObject allows the return of anything */