]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/ufn.c
Fix ldap_send_initial_request() to open connection if not already
[openldap] / libraries / libldap / ufn.c
index f87af4d87a710fb1a55990e6b1ce8e28970d190d..342bd8a1e94e1068b2374780c5cf84e37d8563cf 100644 (file)
@@ -1,4 +1,8 @@
 /*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+/*  Portions
  *  Copyright (c) 1990 Regents of the University of Michigan.
  *  All rights reserved.
  *
 
 #include "portable.h"
 
-#ifndef lint 
-static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
 #include <stdio.h>
 #include <ac/string.h>
 #include <ctype.h>
 #include <stdlib.h>
 
 #include <ac/socket.h>
+#include <ac/time.h>
 
-#include "lber.h"
-#include "ldap.h"
-
+#include "ldap-int.h"
 #include "ldapconfig.h"
 
 typedef int (*cancelptype) LDAP_P(( void *cancelparm ));
 
+/* local functions */
 static int ldap_ufn_search_ctx LDAP_P(( LDAP *ld, char **ufncomp, int ncomp, 
        char *prefix, char **attrs, int attrsonly, LDAPMessage **res, 
        cancelptype cancelproc, void *cancelparm, char *tag1, char *tag2,
@@ -33,7 +33,6 @@ static LDAPMessage *ldap_msg_merge LDAP_P(( LDAP *ld, LDAPMessage *a, LDAPMessag
 static LDAPMessage *ldap_ufn_expand LDAP_P(( LDAP *ld, cancelptype cancelproc,
        void *cancelparm, char **dns, char *filter, int scope,
        char **attrs, int aonly, int *err ));
-LDAPFiltDesc *ldap_ufn_setfilter LDAP_P(( LDAP *ld, char *fname ));
 
 /*
  * ldap_ufn_search_ctx - do user friendly searching; provide cancel feature;
@@ -73,7 +72,6 @@ ldap_ufn_search_ctx( LDAP *ld, char **ufncomp, int ncomp, char *prefix,
        LDAPFiltInfo    *fi;
        LDAPMessage     *tmpcand;
        LDAPMessage     *candidates;
-       LDAPMessage     *ldap_msg_merge(), *ldap_ufn_expand();
        static char     *objattrs[] = { "objectClass", NULL };
 
        /* 
@@ -99,7 +97,8 @@ ldap_ufn_search_ctx( LDAP *ld, char **ufncomp, int ncomp, char *prefix,
 
                        if ( (quote = strrchr( ufncomp[ncomp], '"' )) != NULL )
                                *quote = '\0';
-                       strcpy( ufncomp[ncomp], ufncomp[ncomp] + 1 );
+                       SAFEMEMCPY( ufncomp[ncomp], ufncomp[ncomp] + 1,
+                                   strlen( ufncomp[ncomp] + 1 ) + 1 );
                }
                if ( ncomp == 0 )
                        phase = 3;