]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/entry.c
Fix access_allowed() error checking bug
[openldap] / servers / slapd / entry.c
index 98f5842f8a45e66f9544ee3430d512900406c6dd..181a2933a17f100eff3340c847ab2b3aed28fbec 100644 (file)
@@ -112,15 +112,13 @@ str2entry( char *s )
 #ifdef NEW_LOGGING
                                LDAP_LOG( OPERATION, DETAIL1, "str2entry: "
                                        "entry %ld has multiple DNs \"%s\" and \"%s\"\n",
-                                       (long) e->e_id, e->e_dn,
-                                       vals[0].bv_val != NULL ? vals[0].bv_val : ""  );
+                                       (long) e->e_id, e->e_dn, vals[0].bv_val );
 #else
                                Debug( LDAP_DEBUG_ANY, "str2entry: "
                                        "entry %ld has multiple DNs \"%s\" and \"%s\"\n",
-                                   (long) e->e_id, e->e_dn,
-                                       vals[0].bv_val != NULL ? vals[0].bv_val : "" );
+                                   (long) e->e_id, e->e_dn, vals[0].bv_val );
 #endif
-                               if( vals[0].bv_val != NULL ) free( vals[0].bv_val );
+                               free( vals[0].bv_val );
                                entry_free( e );
                                return NULL;
                        }
@@ -390,17 +388,19 @@ entry_cmp( Entry *e1, Entry *e2 )
 }
 
 int
-entry_dn_cmp( Entry *e1, Entry *e2 )
+entry_dn_cmp( const void *v_e1, const void *v_e2 )
 {
        /* compare their normalized UPPERCASED dn's */
+       const Entry *e1 = v_e1, *e2 = v_e2;
        int rc = e1->e_nname.bv_len - e2->e_nname.bv_len;
        if (rc) return rc;
        return( strcmp( e1->e_ndn, e2->e_ndn ) );
 }
 
 int
-entry_id_cmp( Entry *e1, Entry *e2 )
+entry_id_cmp( const void *v_e1, const void *v_e2 )
 {
+       const Entry *e1 = v_e1, *e2 = v_e2;
        return( e1->e_id < e2->e_id ? -1 : (e1->e_id > e2->e_id ? 1 : 0) );
 }