]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/oc.c
fix build without TLS
[openldap] / servers / slapd / oc.c
index a483922aa31b07010dd65ec5e30c1e30f7f7089c..f49c45c3a0d2fb5e2eebfadd451d7e9ba7de036a 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2006 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -135,6 +135,8 @@ static Avlnode      *oc_cache = NULL;
 static LDAP_STAILQ_HEAD(OCList, slap_object_class) oc_list
        = LDAP_STAILQ_HEAD_INITIALIZER(oc_list);
 
+ObjectClass *oc_sys_tail;
+
 static int
 oc_index_cmp(
        const void *v_oir1,
@@ -669,7 +671,15 @@ oc_insert(
                        names++;
                }
        }
-       LDAP_STAILQ_INSERT_TAIL( &oc_list, soc, soc_next );
+       if ( soc->soc_flags & SLAP_OC_HARDCODE ) {
+               prev = oc_sys_tail;
+               oc_sys_tail = soc;
+       }
+       if ( prev ) {
+               LDAP_STAILQ_INSERT_AFTER( &oc_list, prev, soc, soc_next );
+       } else {
+               LDAP_STAILQ_INSERT_TAIL( &oc_list, soc, soc_next );
+       }
 
        return 0;
 }
@@ -796,7 +806,7 @@ oc_unparse( BerVarray *res, ObjectClass *start, ObjectClass *end, int sys )
        /* count the result size */
        i = 0;
        for ( oc=start; oc; oc=LDAP_STAILQ_NEXT(oc, soc_next)) {
-               if ( sys && !(oc->soc_flags & SLAP_OC_HARDCODE)) continue;
+               if ( sys && !(oc->soc_flags & SLAP_OC_HARDCODE)) break;
                i++;
                if ( oc == end ) break;
        }
@@ -813,7 +823,7 @@ oc_unparse( BerVarray *res, ObjectClass *start, ObjectClass *end, int sys )
        i = 0;
        for ( oc=start; oc; oc=LDAP_STAILQ_NEXT(oc, soc_next)) {
                LDAPObjectClass loc, *locp;
-               if ( sys && !(oc->soc_flags & SLAP_OC_HARDCODE)) continue;
+               if ( sys && !(oc->soc_flags & SLAP_OC_HARDCODE)) break;
                if ( oc->soc_oidmacro ) {
                        loc = oc->soc_oclass;
                        loc.oc_oid = oc->soc_oidmacro;