]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-meta/cache-search.c
Fix prev commit, return generated passwd
[openldap] / servers / slapd / back-meta / cache-search.c
index 31effb378fdfd4ca1b3b06d26bbb2f52b7081d5d..e31b1c18119838fe2c091a72c027385fd4eca6fd 100644 (file)
@@ -1,22 +1,25 @@
-/*
- * Copyright (c) 2003 by International Business Machines, Inc.
+/* $OpenLDAP$ */
+/* 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 1999-2003 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>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by the Howard Chu for inclusion
+ * in OpenLDAP Software and subsequently enhanced by Pierangelo
+ * Masarati and Apurva Kumar.
+ */
+/* This is an altered version */
+/*
  * This software is based on the backends back-ldap and back-meta, implemented
  * by Howard Chu <hyc@highlandsun.com>, Mark Valence
  * <kurash@sassafras.com>, Pierangelo Masarati <ando@sys-net.it> and other
@@ -847,11 +850,11 @@ meta_create_entry (
        Attribute               *attr, *soc_attr, **attrp;
        struct berval   dummy = { 0, NULL };
        struct berval   *bv, bdn;
-       const char              *text;
+       const char              *text = NULL;
        char*                   ename = NULL; 
        struct berval   sc = { 0, NULL };
-       char*                   textbuf;
-       size_t                  textlen;
+       char                    textbuf[SLAP_TEXT_BUFLEN];
+       size_t                  textlen = sizeof(textbuf);
 
        if ( ber_scanf( &ber, "{m{", &bdn ) == LBER_ERROR ) {
                result->type = CREATE_ENTRY_ERR;        
@@ -1832,10 +1835,13 @@ cache_back_sentry(
                rs->sr_entry->e_nname = ndn; 
 
                op->o_callback = cb; 
-               return 0; 
+               return LDAP_SUCCESS; 
+
        } else if (rs->sr_type == REP_RESULT) { 
                op->o_callback = NULL; 
                send_ldap_result( op, rs ); 
-               return 0
+               return LDAP_SUCCESS
        }
+
+       return LDAP_SUCCESS;
 }