]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slapi/slapi_ops.c
honor '!' (objectClass negation) when checking attribute presence in list
[openldap] / servers / slapd / slapi / slapi_ops.c
index 514f0e33891802cf2b4fec5996fb789e3dee3ba4..8cfc95d74c745c8b5aadd60397f22bda3c4d1a85 100644 (file)
@@ -1,21 +1,23 @@
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
- */
-/*
- *  Copyright IBM Corp. 1997,2002
- *  Use of this source code is subject to the terms of The OpenLDAP Public 
- *  License (version 2.7 or later).
- *  No trademarks of the IBM Corporation are to be used to identify, endorse 
- *  or promote  any products derived from this code without the prior 
- *  written consent of IBM 
- */
-/*
- * Portions (C) Copyright PADL Software Pty Ltd. 2003
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 2002-2003 The OpenLDAP Foundation.
+ * Portions Copyright 1997,2002-2003 IBM Corporation.
+ * All rights reserved.
+ *
  * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that this notice is preserved
- * and that due credit is given to PADL Software Pty Ltd. This software
- * is provided ``as is'' without express or implied warranty.
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by IBM Corporation for use in
+ * IBM products and subsequently ported to OpenLDAP Software by
+ * Steve Omrani.  Additional significant contributors include:
+ *   Luke Howard
  */
 
 #include "portable.h"
@@ -59,12 +61,12 @@ internal_search_entry(
        Operation       *op,
        SlapReply       *rs )
 {
-       char *ent2str = NULL;
        int nentries = 0, len = 0, i = 0;
        Slapi_Entry **head = NULL, **tp;
-       
-       ent2str = slapi_entry2str( rs->sr_entry, &len );
-       if ( ent2str == NULL ) {
+       Slapi_Entry *entry;
+
+       entry = slapi_entry_dup( rs->sr_entry );
+       if ( entry == NULL ) {
                return 1;
        }
 
@@ -77,24 +79,19 @@ internal_search_entry(
        if ( nentries == 0 ) {
                tp = (Slapi_Entry **)slapi_ch_malloc( 2 * sizeof(Slapi_Entry *) );
                if ( tp == NULL ) {
+                       slapi_entry_free( entry );
                        return 1;
                }
 
-               tp[ 0 ] = (Slapi_Entry *)str2entry( ent2str );
-               if ( tp[ 0 ] == NULL ) { 
-                       return 1;
-               }
-
+               tp[ 0 ] = entry;
        } else {
                tp = (Slapi_Entry **)slapi_ch_realloc( (char *)head,
                                sizeof(Slapi_Entry *) * ( i + 1 ) );
                if ( tp == NULL ) {
+                       slapi_entry_free( entry );
                        return 1;
                }
-               tp[ i - 1 ] = (Slapi_Entry *)str2entry( ent2str );
-               if ( tp[ i - 1 ] == NULL ) { 
-                       return 1;
-               }
+               tp[ i - 1 ] = entry;
        }
        tp[ i ] = NULL;
                  
@@ -173,7 +170,6 @@ slapiConnectionInit(
        c->c_dn.bv_len = 0;
        c->c_ndn.bv_val = NULL;
        c->c_ndn.bv_len = 0;
-       c->c_groups = NULL;
 
        c->c_listener = &slap_unknown_listener;
        ber_dupbv( &c->c_peer_domain, (struct berval *)&slap_unknown_bv );
@@ -1156,6 +1152,7 @@ slapi_search_internal_bind(
                for (i = 0; attrs[i] != 0; i++) {
                        an[i].an_desc = NULL;
                        an[i].an_oc = NULL;
+                       an[i].an_oc_exclude = 0;
                        an[i].an_name.bv_val = slapi_ch_strdup(attrs[i]);
                        an[i].an_name.bv_len = strlen(attrs[i]);
                        slap_bv2ad( &an[i].an_name, &an[i].an_desc, &text );