]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/sessionlog.c
Fix prev commit
[openldap] / servers / slapd / sessionlog.c
index cb759ee7251439316ae0b958e416f1eddb88f46a..5d8308a07d28a7b5468209ac5aea8fab52d85734 100644 (file)
@@ -1,27 +1,18 @@
+/* sessionlog.c -- Session History Management Routines */
 /* $OpenLDAP$ */
-/*
- * Session History Management Routines
- */
-/*
- * Copyright 2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
- */
-/* Copyright (c) 2003 by International Business Machines, Inc.
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute this
- * Software with or without fee, provided that the above copyright notice and
- * all paragraphs of this notice appear in all copies, and that the name of IBM
- * not be used in connection with the marketing of any product incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
+ * Copyright 2003-2004 The OpenLDAP Foundation.
+ * Portions Copyright 2003 IBM Corporation.
+ * All rights reserved.
  *
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE.  IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * Redistribution and use in source and binary forms, with or without
+ * 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>.
  */
 
 #include "portable.h"
@@ -54,6 +45,7 @@ slap_send_session_log(
 
        uuid_attr[0].an_desc = NULL;
        uuid_attr[0].an_oc = NULL;
+       uuid_attr[0].an_oc_exclude = 0;
        uuid_attr[0].an_name.bv_len = 0;
        uuid_attr[0].an_name.bv_val = NULL;
        e.e_attrs = NULL;
@@ -96,12 +88,13 @@ slap_send_session_log(
                        rs->sr_attrs = uuid_attr;
                        rs->sr_ctrls = ctrls;
                        result = send_search_entry( op, rs );
-                       ch_free( ctrls[num_ctrls-1]->ldctl_value.bv_val );
-                       ch_free( ctrls[--num_ctrls] );
+                       sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val, op->o_tmpmemctx );
+                       sl_free( ctrls[--num_ctrls], op->o_tmpmemctx );
                        ctrls[num_ctrls] = NULL;
                        rs->sr_ctrls = NULL;
                }
        }
+       return LDAP_SUCCESS;
 }
 
 int
@@ -116,7 +109,7 @@ slap_add_session_log(
 
        slog_e = (struct slog_entry *) ch_calloc (1, sizeof( struct slog_entry ));
        a = attr_find( e->e_attrs, slap_schema.si_ad_entryUUID );
-       ber_dupbv( &slog_e->sl_uuid, &a->a_vals[0] );
+       ber_dupbv( &slog_e->sl_uuid, &a->a_nvals[0] );
        ber_dupbv( &slog_e->sl_name, &e->e_name );
        ber_dupbv( &slog_e->sl_csn,  &op->o_sync_csn );
        LDAP_STAILQ_INSERT_TAIL( &sop->o_sync_slog_list, slog_e, sl_link );