int sizelimit = FAX_MAXAMBIGUOUS;
int deref = LDAP_DEREF_ALWAYS;
- if ( (ld = ldap_open( NULL, 0 )) == NULL ) {
- syslog( LOG_ALERT, "ldap_open failed" );
+ if ( (ld = ldap_init( NULL, 0 )) == NULL ) {
+ syslog( LOG_ALERT, "ldap_init failed" );
return( -1 );
}
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
- if ( (ld = ldap_open( ldaphost, 0 )) == NULL ) {
- perror( "ldap_open" );
+ if ( (ld = ldap_init( ldaphost, 0 )) == NULL ) {
+ perror( "ldap_init" );
exit( -1 );
}
fd_set readfds;
LDAP *ld;
- if ( (ld = ldap_open( ldaphost, ldapport )) == NULL ) {
+ if ( (ld = ldap_init( ldaphost, ldapport )) == NULL ) {
fprintf( stderr, FINGER_UNAVAILABLE );
- perror( "ldap_open" );
+ perror( "ldap_init" );
exit( 1 );
}
if ( *query == '~' || *query == '@' ) {
ld = NULL;
- } else if ( (ld = ldap_open( ldaphost, 0 )) == NULL ) {
+ } else if ( (ld = ldap_init( ldaphost, 0 )) == NULL ) {
fprintf(fp,
"0An error occurred (explanation)\t@%d\t%s\t%d\r\n",
LDAP_SERVER_DOWN, myhost, myport );
/* NOT REACHED */
}
- if ( (ld = ldap_open( ldaphost, ldapport )) == NULL ) {
- if ( debug ) perror( "ldap_open" );
+ if ( (ld = ldap_init( ldaphost, ldapport )) == NULL ) {
+ if ( debug ) perror( "ldap_init" );
fprintf(fp, "0An error occurred (explanation)\tE%d\t%s\t%d\r\n",
LDAP_SERVER_DOWN, myhost, myport );
fprintf( fp, ".\r\n" );
{
int opt;
- if ( (ld = ldap_open( ldaphost, 0 )) == NULL ) {
- syslog( LOG_ALERT, "ldap_open failed" );
+ if ( (ld = ldap_init( ldaphost, 0 )) == NULL ) {
+ syslog( LOG_ALERT, "ldap_init failed" );
return( -1 );
}
ldp = cldap_open( ldaphost, ldapport );
else
#endif /* LDAP_CONNECTIONLESS */
- ldp = ldap_open( ldaphost, ldapport );
+ ldp = ldap_init( ldaphost, ldapport );
if ( ldp == NULL ) {
strcat( reply, errpreface );
* are meaningless since we will immediately be doing a null bind
* because we want to be sure to use TCP, not UDP.
*/
- if ((ld = ldap_open(server, ldap_port)) == NULL) {
- fprintf(stderr, " The LDAP Directory is temporarily unavailable. Please try again later.\n");
+ if ((ld = ldap_init(server, ldap_port)) == NULL) {
+ fprintf(stderr, " Initialization of LDAP session failed.\n");
exit(0);
/* NOTREACHED */
}
rc = user_tailor();
- if (!(ld = ldap_open(hostname, portnum))) {
- fprintf(stderr, "%s: unable to connect to server at host `%s' on port %d\n",
+ if (!(ld = ldap_init(hostname, portnum))) {
+ fprintf(stderr, "%s: unable to initialize LDAP session (%s:%d)\n",
progname, hostname, portnum);
exit(2);
}
time(&now);
sprintf(temp,"\n==< Results >==\n\n");
fputs(temp,logfp);
- sprintf(temp,"** performing ldap_open at %s\n", ctime(&now));
+ sprintf(temp,"** performing ldap_init at %s\n", ctime(&now));
fputs(temp,logfp);
fflush(logfp);
fclose(logfp);
}
}
- if ( (ld = ldap_open(ldap_data.servername, ldap_data.ldap_port_num) ) == NULL)
+ if ( (ld = ldap_init(ldap_data.servername, ldap_data.ldap_port_num) ) == NULL)
{
- printf("<font color=red><b>ldap_open error</b></font>\n");
+ printf("<font color=red><b>ldap_init error</b></font>\n");
if (ldap_data.debug != 0) {
if ((logfp = fopen("web_ldap.log","a")) == 0) {
}
else {
- sprintf(temp,"++ ldap_open error\n");
+ sprintf(temp,"++ ldap_init error\n");
fputs(temp,logfp);
fflush(logfp);
fclose(logfp);
}
}
- if ( (ld = ldap_open( ldaphost, LDAP_PORT )) == NULL ) {
+ if ( (ld = ldap_init( ldaphost, LDAP_PORT )) == NULL ) {
printFormatted( lineLength, TRUE, stdout,
"Connection to LDAP port on %s has failed", ldaphost );
- syslog( LOG_ERR, "Connection to LDAP port on %s has failed",
+ syslog( LOG_ERR, "Initialization of LDAP session (%s)",
ldaphost );
exit( 1 );
}
exit( 1 );
}
- printf( "%sldap_open( %s, %d )\n", cldapflg ? "c" : "",
+ printf( "%s( %s, %d )\n",
+ cldapflg ? "cldap_open" : "ldap_init",
host == NULL ? "(null)" : host, port );
if ( cldapflg ) {
ld = cldap_open( host, port );
#endif /* LDAP_CONNECTIONLESS */
} else {
- ld = ldap_open( host, port );
+ ld = ldap_init( host, port );
}
if ( ld == NULL ) {
- perror( "ldap_open" );
+ perror( cldapflg ? "cldap_open" : "ldap_init" );
exit(1);
}
fflush( stdout );
}
- if ( (ld = ldap_open( ldaphost, 0 )) == NULL ) {
- perror( "ldap_open" );
+ if ( (ld = ldap_init( ldaphost, 0 )) == NULL ) {
+ perror( "ldap_init" );
return( NULL );
}
free( ldapbase );
ldapbase = strdup( buf );
- if ( (ld = ldap_open( ldaphost, 0 )) == NULL ) {
- perror( "ldap_open" );
+ if ( (ld = ldap_init( ldaphost, 0 )) == NULL ) {
+ perror( "ldap_init" );
return( NULL );
}
ldap_debug = 255;
lber_debug = 255;
*/
- if ( (ld = ldap_open( "vertigo:5555", 0 )) == NULL ) {
- perror( "ldap_open" );
+ if ( (ld = ldap_init( "vertigo:5555", 0 )) == NULL ) {
+ perror( "ldap_init" );
exit( 1 );
}
ri->ri_ldp = NULL;
}
- Debug( LDAP_DEBUG_ARGS, "Open connection to %s:%d\n",
+ Debug( LDAP_DEBUG_ARGS, "Initializing session to %s:%d\n",
ri->ri_hostname, ri->ri_port, 0 );
- ri->ri_ldp = ldap_open( ri->ri_hostname, ri->ri_port );
+ ri->ri_ldp = ldap_init( ri->ri_hostname, ri->ri_port );
if ( ri->ri_ldp == NULL ) {
- Debug( LDAP_DEBUG_ANY, "Error: ldap_open(%s, %d) failed: %s\n",
+ Debug( LDAP_DEBUG_ANY, "Error: ldap_init(%s, %d) failed: %s\n",
ri->ri_hostname, ri->ri_port, sys_errlist[ errno ] );
return( BIND_ERR_OPEN );
}