/* Portions
* Copyright (c) 1995 Regents of the University of Michigan.
* All rights reserved.
- ******************************************************************************
+ */
+/*---
* This notice applies to changes, created by or for Novell, Inc.,
* to preexisting works for which notices appear elsewhere in this file.
*
* WORK OTHER THAN AS AUTHORIZED IN VERSION 2.0.1 OF THE OPENLDAP PUBLIC
* LICENSE, OR OTHER PRIOR WRITTEN CONSENT FROM NOVELL, COULD SUBJECT THE
* PERPETRATOR TO CRIMINAL AND CIVIL LIABILITY.
- ******************************************************************************
+ *---
* Modification to OpenLDAP source by Novell, Inc.
* April 2000 sfs Added code to chase V3 referrals
- *
* request.c - sending of ldap requests; handling of referrals
*/
refs = NULL;
/* parse out & follow referrals */
for( i=0; refarray[i] != NULL; i++) {
-
/* Parse the referral URL */
if (( rc = ldap_url_parse( refarray[i], &srv)) != LDAP_SUCCESS) {
ld->ld_errno = rc;
goto done;
}
+ /* treat ldap://hostpart and ldap://hostpart/ the same */
+ if ( srv->lud_dn && srv->lud_dn[0] == '\0' ) {
+ LDAP_FREE( srv->lud_dn );
+ srv->lud_dn = NULL;
+ }
+
/* check connection for re-bind in progress */
if (( lc = find_connection( ld, srv, 1 )) != NULL ) {
if( lc->lconn_rebind_inprogress) {
continue;
}
+ /* copy the complete referral for rebind process */
+ rinfo.ri_url = LDAP_STRDUP( ref );
+
*hadrefp = 1;
if (( refdn = strchr( tmpref, '/' )) != NULL ) {
*refdn++ = '\0';
newdn = refdn[0] != '?' && refdn[0] != '\0';
-
if( !newdn ) refdn = NULL;
} else {
newdn = 0;
/* Portions
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
- ******************************************************************************
+ */
+/*---
* This notice applies to changes, created by or for Novell, Inc.,
* to preexisting works for which notices appear elsewhere in this file.
*
* WORK OTHER THAN AS AUTHORIZED IN VERSION 2.0.1 OF THE OPENLDAP PUBLIC
* LICENSE, OR OTHER PRIOR WRITTEN CONSENT FROM NOVELL, COULD SUBJECT THE
* PERPETRATOR TO CRIMINAL AND CIVIL LIABILITY.
- ******************************************************************************
+ *---
* Modification to OpenLDAP source by Novell, Inc.
* April 2000 sfs Add code to process V3 referrals and search results
*
{
v3ref = -1; /* Assume referral not chased and return it to app */
/* Get the referral list */
- if( ber_scanf( &tmpber, "v", &refs) == LBER_ERROR) {
+ if( ber_scanf( &tmpber, "{v}", &refs) == LBER_ERROR) {
rc = LDAP_DECODING_ERROR;
lr->lr_status = LDAP_REQST_COMPLETED;
Debug( LDAP_DEBUG_TRACE,