mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-22 23:59:34 -05:00
Remove LDAP_DEPRECATED dependency
This commit is contained in:
parent
4d29df5bd1
commit
d5936c1242
1 changed files with 22 additions and 27 deletions
|
|
@ -32,7 +32,6 @@
|
||||||
#include <ac/unistd.h>
|
#include <ac/unistd.h>
|
||||||
#include <ac/errno.h>
|
#include <ac/errno.h>
|
||||||
|
|
||||||
#define LDAP_DEPRECATED 1
|
|
||||||
#include <ldap.h>
|
#include <ldap.h>
|
||||||
|
|
||||||
#include "lutil_ldap.h"
|
#include "lutil_ldap.h"
|
||||||
|
|
@ -651,35 +650,31 @@ tool_conn_setup( int not, void (*private_setup)( LDAP * ) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( !not ) {
|
if ( !not ) {
|
||||||
/* connect to server */
|
int rc;
|
||||||
|
|
||||||
if( ( ldaphost != NULL || ldapport ) && ( ldapuri == NULL ) ) {
|
if( ( ldaphost != NULL || ldapport ) && ( ldapuri == NULL ) ) {
|
||||||
if ( verbose ) {
|
/* construct URL */
|
||||||
fprintf( stderr, "ldap_init( %s, %d )\n",
|
LDAPURLDesc url;
|
||||||
ldaphost != NULL ? ldaphost : "<DEFAULT>",
|
memset( &url, 0, sizeof(url));
|
||||||
ldapport );
|
|
||||||
}
|
|
||||||
|
|
||||||
ld = ldap_init( ldaphost, ldapport );
|
url.lud_scheme = "ldap";
|
||||||
if( ld == NULL ) {
|
url.lud_host = ldaphost;
|
||||||
char buf[20 + sizeof(": ldap_init")];
|
url.lud_port = ldapport;
|
||||||
sprintf( buf, "%.20s: ldap_init", prog );
|
url.lud_scope = LDAP_SCOPE_DEFAULT;
|
||||||
perror( buf );
|
|
||||||
exit( EXIT_FAILURE );
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
ldapuri = ldap_url_desc2str( &url );
|
||||||
int rc;
|
}
|
||||||
if ( verbose ) {
|
|
||||||
fprintf( stderr, "ldap_initialize( %s )\n",
|
if ( verbose ) {
|
||||||
ldapuri != NULL ? ldapuri : "<DEFAULT>" );
|
fprintf( stderr, "ldap_initialize( %s )\n",
|
||||||
}
|
ldapuri != NULL ? ldapuri : "<DEFAULT>" );
|
||||||
rc = ldap_initialize( &ld, ldapuri );
|
}
|
||||||
if( rc != LDAP_SUCCESS ) {
|
rc = ldap_initialize( &ld, ldapuri );
|
||||||
fprintf( stderr,
|
if( rc != LDAP_SUCCESS ) {
|
||||||
"Could not create LDAP session handle (%d): %s\n",
|
fprintf( stderr,
|
||||||
rc, ldap_err2string(rc) );
|
"Could not create LDAP session handle (%d): %s\n",
|
||||||
exit( EXIT_FAILURE );
|
rc, ldap_err2string(rc) );
|
||||||
}
|
exit( EXIT_FAILURE );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( private_setup ) private_setup( ld );
|
if( private_setup ) private_setup( ld );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue