mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
References with empty dn (ITS#817)
This commit is contained in:
parent
7543094129
commit
8e6062eb82
@ -440,7 +440,7 @@ LDAP_F (void) ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbin
|
|||||||
LDAP_F (void) ldap_dump_connection( LDAP *ld, LDAPConn *lconns, int all );
|
LDAP_F (void) ldap_dump_connection( LDAP *ld, LDAPConn *lconns, int all );
|
||||||
LDAP_F (void) ldap_dump_requests_and_responses( LDAP *ld );
|
LDAP_F (void) ldap_dump_requests_and_responses( LDAP *ld );
|
||||||
LDAP_F (int) ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp );
|
LDAP_F (int) ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp );
|
||||||
LDAP_F (int) ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, char **referralsp, int *hadrefp );
|
LDAP_F (int) ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char **referralsp, int *hadrefp );
|
||||||
LDAP_F (int) ldap_append_referral( LDAP *ld, char **referralsp, char *s );
|
LDAP_F (int) ldap_append_referral( LDAP *ld, char **referralsp, char *s );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -575,13 +575,14 @@ ldap_free_request( LDAP *ld, LDAPRequest *lr )
|
|||||||
* (IN) lr = LDAP Request structure
|
* (IN) lr = LDAP Request structure
|
||||||
* (IN) refs = array of pointers to referral strings that we will chase
|
* (IN) refs = array of pointers to referral strings that we will chase
|
||||||
* The array will be free'd by this function when no longer needed
|
* The array will be free'd by this function when no longer needed
|
||||||
|
* (IN) sref != 0 if following search reference
|
||||||
* (OUT) errstrp = Place to return a string of referrals which could not be followed
|
* (OUT) errstrp = Place to return a string of referrals which could not be followed
|
||||||
* (OUT) hadrefp = 1 if sucessfully followed referral
|
* (OUT) hadrefp = 1 if sucessfully followed referral
|
||||||
*
|
*
|
||||||
* Return value - number of referrals followed
|
* Return value - number of referrals followed
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, char **errstrp, int *hadrefp )
|
ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char **errstrp, int *hadrefp )
|
||||||
{
|
{
|
||||||
char *unfollowed;
|
char *unfollowed;
|
||||||
int unfollowedcnt = 0;
|
int unfollowedcnt = 0;
|
||||||
@ -687,6 +688,11 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, char **errstrp,
|
|||||||
* Note: In the future we also need to replace the filter if one
|
* Note: In the future we also need to replace the filter if one
|
||||||
* was provided with the search reference
|
* was provided with the search reference
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* For references we don't want old dn if new dn empty */
|
||||||
|
if ( sref && srv->lud_dn == NULL )
|
||||||
|
srv->lud_dn = LDAP_STRDUP( "" );
|
||||||
|
|
||||||
if (( ber = re_encode_request( ld, origreq->lr_ber,
|
if (( ber = re_encode_request( ld, origreq->lr_ber,
|
||||||
++ld->ld_msgid, &srv->lud_dn, &rinfo.ri_request )) == NULL ) {
|
++ld->ld_msgid, &srv->lud_dn, &rinfo.ri_request )) == NULL ) {
|
||||||
ld->ld_errno = LDAP_ENCODING_ERROR;
|
ld->ld_errno = LDAP_ENCODING_ERROR;
|
||||||
|
@ -431,7 +431,7 @@ try_read1msg(
|
|||||||
} else {
|
} else {
|
||||||
/* Note: refs arrary is freed by ldap_chase_v3referrals */
|
/* Note: refs arrary is freed by ldap_chase_v3referrals */
|
||||||
refer_cnt = ldap_chase_v3referrals( ld, lr, refs,
|
refer_cnt = ldap_chase_v3referrals( ld, lr, refs,
|
||||||
&lr->lr_res_error, &hadref );
|
1, &lr->lr_res_error, &hadref );
|
||||||
if ( refer_cnt > 0 ) { /* sucessfully chased reference */
|
if ( refer_cnt > 0 ) { /* sucessfully chased reference */
|
||||||
/* If haven't got end search, set chasing referrals */
|
/* If haven't got end search, set chasing referrals */
|
||||||
if( lr->lr_status != LDAP_REQST_COMPLETED) {
|
if( lr->lr_status != LDAP_REQST_COMPLETED) {
|
||||||
@ -470,7 +470,7 @@ try_read1msg(
|
|||||||
* Note: refs arrary is freed by ldap_chase_v3referrals
|
* Note: refs arrary is freed by ldap_chase_v3referrals
|
||||||
*/
|
*/
|
||||||
refer_cnt = ldap_chase_v3referrals( ld, lr, refs,
|
refer_cnt = ldap_chase_v3referrals( ld, lr, refs,
|
||||||
&lr->lr_res_error, &hadref );
|
0, &lr->lr_res_error, &hadref );
|
||||||
lr->lr_status = LDAP_REQST_COMPLETED;
|
lr->lr_status = LDAP_REQST_COMPLETED;
|
||||||
Debug( LDAP_DEBUG_TRACE,
|
Debug( LDAP_DEBUG_TRACE,
|
||||||
"read1msg: referral chased, mark request completed, id = %d\n",
|
"read1msg: referral chased, mark request completed, id = %d\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user