]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/at.c
ITS#4458 re-encode passwd request
[openldap] / servers / slapd / at.c
index 2f5c57d700c946e03a96d2d76ecf85c775c75dd5..acdeff290bc7b28662e91ecc7738efadd25e1b9b 100644 (file)
@@ -61,6 +61,9 @@ static Avlnode        *attr_cache = NULL;
 static LDAP_STAILQ_HEAD(ATList, slap_attribute_type) attr_list
        = LDAP_STAILQ_HEAD_INITIALIZER(attr_list);
 
+/* Last hardcoded attribute registered */
+AttributeType *at_sys_tail;
+
 int at_oc_cache;
 
 static int
@@ -229,7 +232,7 @@ at_delete_names( AttributeType *at )
 /* Mark the attribute as deleted, remove from list, and remove all its
  * names from the AVL tree. Leave the OID in the tree.
  */
-int
+void
 at_delete( AttributeType *at )
 {
        at->sat_flags |= SLAP_AT_DELETED;
@@ -237,8 +240,6 @@ at_delete( AttributeType *at )
        LDAP_STAILQ_REMOVE(&attr_list,at,slap_attribute_type,sat_next);
 
        at_delete_names( at );
-
-       return 0;
 }
 
 static void
@@ -527,6 +528,10 @@ at_insert(
                }
        }
 
+       if ( sat->sat_flags & SLAP_AT_HARDCODE ) {
+               prev = at_sys_tail;
+               at_sys_tail = sat;
+       }
        if ( prev ) {
                LDAP_STAILQ_INSERT_AFTER( &attr_list, prev, sat, sat_next );
        } else {
@@ -919,7 +924,7 @@ at_unparse( BerVarray *res, AttributeType *start, AttributeType *end, int sys )
        /* count the result size */
        i = 0;
        for ( at=start; at; at=LDAP_STAILQ_NEXT(at, sat_next)) {
-               if ( sys && !(at->sat_flags & SLAP_AT_HARDCODE)) continue;
+               if ( sys && !(at->sat_flags & SLAP_AT_HARDCODE)) break;
                i++;
                if ( at == end ) break;
        }
@@ -936,7 +941,7 @@ at_unparse( BerVarray *res, AttributeType *start, AttributeType *end, int sys )
        i = 0;
        for ( at=start; at; at=LDAP_STAILQ_NEXT(at, sat_next)) {
                LDAPAttributeType lat, *latp;
-               if ( sys && !(at->sat_flags & SLAP_AT_HARDCODE)) continue;
+               if ( sys && !(at->sat_flags & SLAP_AT_HARDCODE)) break;
                if ( at->sat_oidmacro ) {
                        lat = at->sat_atype;
                        lat.at_oid = at->sat_oidmacro;