mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-31 03:59:34 -05:00
s/ldap_open/ldap_init/ calls... ldap_open is deprecated.
This commit is contained in:
parent
4c36726ee0
commit
cb68aab469
15 changed files with 35 additions and 34 deletions
|
|
@ -323,8 +323,8 @@ connect_to_x500( void )
|
|||
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 );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@ main( int argc, char **argv )
|
|||
(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 );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -158,9 +158,9 @@ do_query( void )
|
|||
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 );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ do_queries( int s )
|
|||
|
||||
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 );
|
||||
|
|
|
|||
|
|
@ -441,8 +441,8 @@ do_queries( int s )
|
|||
/* 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" );
|
||||
|
|
|
|||
|
|
@ -360,8 +360,8 @@ connect_to_x500( void )
|
|||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ query_cmd( struct msginfo *msgp, char *reply )
|
|||
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 );
|
||||
|
|
|
|||
|
|
@ -648,8 +648,8 @@ initialize_client( void )
|
|||
* 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 */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -639,8 +639,8 @@ int main(int argc, char **argv)
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -321,20 +321,20 @@ main(int argc, char ** argv) {
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -178,10 +178,10 @@ char **argv;
|
|||
}
|
||||
}
|
||||
|
||||
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 );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -346,7 +346,8 @@ main( int argc, char **argv )
|
|||
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 ) {
|
||||
|
|
@ -354,11 +355,11 @@ main( int argc, char **argv )
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -383,8 +383,8 @@ start_ldap_search(
|
|||
fflush( stdout );
|
||||
}
|
||||
|
||||
if ( (ld = ldap_open( ldaphost, 0 )) == NULL ) {
|
||||
perror( "ldap_open" );
|
||||
if ( (ld = ldap_init( ldaphost, 0 )) == NULL ) {
|
||||
perror( "ldap_init" );
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
|
|
@ -976,8 +976,8 @@ bind_to_destination_ldap(
|
|||
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 );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ main( int argc, char **argv )
|
|||
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 );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -611,11 +611,11 @@ do_bind(
|
|||
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 );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue