*/
#include "ldap-int.h"
+/* local functions */
+#ifndef HAVE_GETLINE
+static char *getline LDAP_P(( char *line, int len, FILE *fp, char *prompt ));
+#endif
+static char **get_list LDAP_P(( char *prompt ));
+static int file_read LDAP_P(( char *path, struct berval *bv ));
+static LDAPMod **get_modlist LDAP_P(( char *prompt1, char *prompt2, char *prompt3 ));
static void handle_result LDAP_P(( LDAP *ld, LDAPMessage *lm ));
static void print_ldap_result LDAP_P(( LDAP *ld, LDAPMessage *lm, char *s ));
static void print_search_entry LDAP_P(( LDAP *ld, LDAPMessage *res ));
#define NOCACHEERRMSG "don't compile with -DLDAP_NOCACHE if you desire local caching"
-char *dnsuffix;
+static char *dnsuffix;
#ifndef HAVE_GETLINE
static char *
result = (char **) realloc( result,
sizeof(char *) * (num + 1) );
- result[num++] = (char *) strdup( buf );
+ result[num++] = (char *) ldap_strdup( buf );
}
if ( result == (char **) 0 )
return( NULL );
getline( buf, sizeof(buf), stdin, prompt2 );
if ( buf[0] == '\0' )
break;
- tmp.mod_type = strdup( buf );
+ tmp.mod_type = ldap_strdup( buf );
tmp.mod_values = get_list( prompt3 );
#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
-int
+static int
bind_prompt( LDAP *ld, char **dnp, char **passwdp, int *authmethodp,
int freeit )
{
int copyoptions = 0;
LDAPURLDesc *ludp;
- extern char *optarg;
- extern int optind;
-
host = NULL;
port = LDAP_PORT;
dnsuffix = "";
break;
case 't': /* copy ber's to given file */
- copyfname = strdup( optarg );
+ copyfname = ldap_strdup( optarg );
copyoptions = LBER_TO_FILE;
break;
case 'T': /* only output ber's to given file */
- copyfname = strdup( optarg );
+ copyfname = ldap_strdup( optarg );
copyoptions = (LBER_TO_FILE | LBER_TO_FILE_ONLY);
break;