Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jaak Ristioja
OpenLDAP
Commits
2c74b5db
Commit
2c74b5db
authored
21 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
follow search references as well
parent
e9188de7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/overlays/chain.c
+66
-4
66 additions, 4 deletions
servers/slapd/overlays/chain.c
with
66 additions
and
4 deletions
servers/slapd/overlays/chain.c
+
66
−
4
View file @
2c74b5db
...
...
@@ -41,20 +41,24 @@ ldap_chain_response( Operation *op, SlapReply *rs )
slap_callback
*
sc
=
op
->
o_callback
;
LDAPControl
**
prev
=
op
->
o_ctrls
;
LDAPControl
**
ctrls
=
NULL
,
authz
;
int
i
,
nctrls
,
rc
;
int
i
,
nctrls
,
rc
=
0
;
int
cache
=
op
->
o_do_not_cache
;
char
*
authzid
=
NULL
;
BerVarray
ref
;
struct
berval
ndn
=
op
->
o_ndn
;
if
(
rs
->
sr_err
!=
LDAP_REFERRAL
)
if
(
rs
->
sr_err
!=
LDAP_REFERRAL
&&
rs
->
sr_type
!=
REP_SEARCHREF
)
return
SLAP_CB_CONTINUE
;
/* currently we assume only one referral destination.
* we'll have to parse this in the future.
*/
/* leave in place if result type is search reference;
* will be cleared later */
ref
=
rs
->
sr_ref
;
rs
->
sr_ref
=
NULL
;
if
(
rs
->
sr_type
!=
REP_SEARCHREF
)
{
rs
->
sr_ref
=
NULL
;
}
op
->
o_bd
->
be_private
=
on
->
on_bi
.
bi_private
;
op
->
o_callback
=
NULL
;
...
...
@@ -118,7 +122,65 @@ ldap_chain_response( Operation *op, SlapReply *rs )
rc
=
ldap_back_compare
(
op
,
rs
);
break
;
case
LDAP_REQ_SEARCH
:
rc
=
ldap_back_search
(
op
,
rs
);
if
(
rs
->
sr_type
==
REP_SEARCHREF
)
{
struct
ldapinfo
li
;
struct
berval
*
curr
=
rs
->
sr_ref
,
odn
=
op
->
o_req_dn
,
ondn
=
op
->
o_req_ndn
;
op
->
o_bd
->
be_private
=
&
li
;
rs
->
sr_type
=
REP_SEARCH
;
rs
->
sr_ref
=
NULL
;
/* copy the private info because we need to modify it */
AC_MEMCPY
(
&
li
,
on
->
on_bi
.
bi_private
,
sizeof
(
struct
ldapinfo
)
);
for
(
;
curr
[
0
].
bv_val
;
curr
++
)
{
LDAPURLDesc
*
srv
;
/* parse reference and use proto://[host][:port]/ only */
rc
=
ldap_url_parse_ext
(
curr
[
0
].
bv_val
,
&
srv
);
if
(
rc
!=
LDAP_SUCCESS
)
{
/* error */
continue
;
}
ber_str2bv
(
srv
->
lud_dn
,
0
,
0
,
&
op
->
o_req_dn
);
op
->
o_req_ndn
=
op
->
o_req_dn
;
/* remove DN essentially because later on
* ldap_initialize() will parse the URL
* as a comma-separated URL list */
srv
->
lud_dn
=
""
;
li
.
url
=
ldap_url_desc2str
(
srv
);
if
(
li
.
url
==
NULL
)
{
/* error */
srv
->
lud_dn
=
op
->
o_req_dn
.
bv_val
;
ldap_free_urldesc
(
srv
);
continue
;
}
/* FIXME: should we also copy filter and scope?
* according to RFC3296, no */
rc
=
ldap_back_search
(
op
,
rs
);
srv
->
lud_dn
=
op
->
o_req_dn
.
bv_val
;
ldap_free_urldesc
(
srv
);
if
(
rc
)
{
/* error */
continue
;
}
}
op
->
o_req_dn
=
odn
;
op
->
o_req_ndn
=
ondn
;
rs
->
sr_type
=
REP_SEARCHREF
;
op
->
o_bd
->
be_private
=
on
->
on_bi
.
bi_private
;
}
else
{
rc
=
ldap_back_search
(
op
,
rs
);
}
break
;
case
LDAP_REQ_EXTENDED
:
rc
=
ldap_back_extended
(
op
,
rs
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment