summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/passthru
diff options
context:
space:
mode:
Diffstat (limited to 'ldap/servers/plugins/passthru')
-rw-r--r--ldap/servers/plugins/passthru/passthru.h1
-rw-r--r--ldap/servers/plugins/passthru/ptbind.c4
-rw-r--r--ldap/servers/plugins/passthru/ptconfig.c10
-rw-r--r--ldap/servers/plugins/passthru/ptutil.c30
4 files changed, 7 insertions, 38 deletions
diff --git a/ldap/servers/plugins/passthru/passthru.h b/ldap/servers/plugins/passthru/passthru.h
index 022a57ae..34f8f696 100644
--- a/ldap/servers/plugins/passthru/passthru.h
+++ b/ldap/servers/plugins/passthru/passthru.h
@@ -163,6 +163,5 @@ void passthru_close_all_connections( PassThruConfig *cfg );
struct berval **passthru_strs2bervals( char **ss );
char ** passthru_bervals2strs( struct berval **bvs );
void passthru_free_bervals( struct berval **bvs );
-char *passthru_urlparse_err2string( int err );
#endif /* _PASSTHRU_H_ */
diff --git a/ldap/servers/plugins/passthru/ptbind.c b/ldap/servers/plugins/passthru/ptbind.c
index 2cce0b57..063ba150 100644
--- a/ldap/servers/plugins/passthru/ptbind.c
+++ b/ldap/servers/plugins/passthru/ptbind.c
@@ -158,7 +158,7 @@ passthru_simple_bind_once_s( PassThruServer *srvr, char *dn,
/*
* Some other error occurred (no result received).
*/
- rc = ldap_get_lderrno( ld, matcheddnp, errmsgp );
+ rc = slapi_ldap_get_lderrno( ld, matcheddnp, errmsgp );
} else {
/*
* Got a result from remote server -- parse it.
@@ -167,7 +167,7 @@ passthru_simple_bind_once_s( PassThruServer *srvr, char *dn,
&referrals, resctrlsp, 1 );
if ( referrals != NULL ) {
*refurlsp = passthru_strs2bervals( referrals );
- ldap_value_free( referrals );
+ slapi_ldap_value_free( referrals );
}
}
diff --git a/ldap/servers/plugins/passthru/ptconfig.c b/ldap/servers/plugins/passthru/ptconfig.c
index b7bb1386..fac0c5bd 100644
--- a/ldap/servers/plugins/passthru/ptconfig.c
+++ b/ldap/servers/plugins/passthru/ptconfig.c
@@ -131,6 +131,7 @@ passthru_config( int argc, char **argv )
*/
prevsrvr = NULL;
for ( i = 0; i < argc; ++i ) {
+ int secure = 0;
char *p = NULL;
srvr = (PassThruServer *)slapi_ch_calloc( 1, sizeof( PassThruServer ));
srvr->ptsrvr_url = slapi_ch_strdup( argv[i] );
@@ -230,10 +231,10 @@ passthru_config( int argc, char **argv )
/*
* parse the LDAP URL
*/
- if (( rc = ldap_url_parse( srvr->ptsrvr_url, &ludp )) != 0 ) {
+ if (( rc = slapi_ldap_url_parse( srvr->ptsrvr_url, &ludp, 0, &secure )) != 0 ) {
slapi_log_error( SLAPI_LOG_FATAL, PASSTHRU_PLUGIN_SUBSYSTEM,
"unable to parse LDAP URL \"%s\" (%s)\n",
- srvr->ptsrvr_url, passthru_urlparse_err2string( rc ));
+ srvr->ptsrvr_url, slapi_urlparse_err2string( rc ));
return( LDAP_PARAM_ERROR );
}
@@ -246,8 +247,7 @@ passthru_config( int argc, char **argv )
srvr->ptsrvr_hostname = slapi_ch_strdup( ludp->lud_host );
srvr->ptsrvr_port = ludp->lud_port;
- srvr->ptsrvr_secure =
- (( ludp->lud_options & LDAP_URL_OPT_SECURE ) != 0 );
+ srvr->ptsrvr_secure = secure;
if (starttls) {
srvr->ptsrvr_secure = 2;
}
@@ -265,7 +265,7 @@ passthru_config( int argc, char **argv )
/*
* split the DN into multiple suffixes (separated by ';')
*/
- if (( suffixarray = ldap_str2charray( ludp->lud_dn, ";" )) == NULL ) {
+ if (( suffixarray = slapi_str2charray( ludp->lud_dn, ";" )) == NULL ) {
slapi_log_error( SLAPI_LOG_FATAL, PASSTHRU_PLUGIN_SUBSYSTEM,
"unable to parse suffix string \"%s\" within \"%s\"\n",
ludp->lud_dn, srvr->ptsrvr_url );
diff --git a/ldap/servers/plugins/passthru/ptutil.c b/ldap/servers/plugins/passthru/ptutil.c
index 399e5b5a..48f3c405 100644
--- a/ldap/servers/plugins/passthru/ptutil.c
+++ b/ldap/servers/plugins/passthru/ptutil.c
@@ -116,33 +116,3 @@ passthru_free_bervals( struct berval **bvs )
}
slapi_ch_free( (void **)&bvs );
}
-
-
-char *
-passthru_urlparse_err2string( int err )
-{
- char *s;
-
- switch( err ) {
- case 0:
- s = "no error";
- break;
- case LDAP_URL_ERR_NOTLDAP:
- s = "missing ldap:// or ldaps://";
- break;
- case LDAP_URL_ERR_NODN:
- s = "missing suffix";
- break;
- case LDAP_URL_ERR_BADSCOPE:
- s = "invalid search scope";
- break;
- case LDAP_URL_ERR_MEM:
- s = "unable to allocate memory";
- break;
- case LDAP_URL_ERR_PARAM:
- s = "bad parameter to an LDAP URL function";
- break;
- }
-
- return( s );
-}