~ttx/openldap/lucid-gssapi-495418

« back to all changes in this revision

Viewing changes to servers/slapd/ad.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-09-07 13:41:10 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090907134110-rsnlhy8b0r21p9bg
Tags: 2.4.18-0ubuntu1
* New upstream release: (LP: #419515):
  + pcache overlay supports disconnected mode.
* Fix nss overlay load (LP: #417163).

Show diffs side-by-side

added added

removed removed

Lines of Context:
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/>.
4
4
 *
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
596
596
                 */
 
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;
 
609
                                                } else {
 
610
                                                        attrs->an_flags &= ~SLAP_AN_OCEXCLUDE;
 
611
                                                }
 
612
                                        } break;
 
613
 
 
614
                                default: /* old (deprecated) way */
 
615
                                        oc = oc_bvfind( &attrs->an_name );
 
616
                                }
 
617
                                attrs->an_oc = oc;
 
618
                        }
 
619
                        attrs->an_flags |= SLAP_AN_OCINITED;
 
620
                }
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;
610
 
                                        }
611
 
                                } break;
612
 
 
613
 
                        default: /* old (deprecated) way */
614
 
                                oc = oc_bvfind( &attrs->an_name );
615
 
                        }
616
 
                        attrs->an_oc = oc;
617
 
                }
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 */
622
626
                                        return 0;
932
936
 
933
937
                anew->an_desc = NULL;
934
938
                anew->an_oc = NULL;
935
 
                anew->an_oc_exclude = 0;
 
939
                anew->an_flags = 0;
936
940
                ber_str2bv(s, 0, 1, &anew->an_name);
937
941
                slap_bv2ad(&anew->an_name, &anew->an_desc, &text);
938
942
                if ( !anew->an_desc ) {
959
963
                                        }
960
964
 
961
965
                                        if ( anew->an_name.bv_val[0] == '!' ) {
962
 
                                                anew->an_oc_exclude = 1;
 
966
                                                anew->an_flags |= SLAP_AN_OCEXCLUDE;
963
967
                                        }
964
968
                                } break;
965
969
 
971
975
                                }
972
976
                        }
973
977
                }
 
978
                anew->an_flags |= SLAP_AN_OCINITED;
974
979
                anew++;
975
980
        }
976
981