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
Tero Saarni
OpenLDAP
Commits
2f02920b
Commit
2f02920b
authored
16 years ago
by
Quanah Gibson-Mount
Browse files
Options
Downloads
Patches
Plain Diff
More for ITS#5927, ITS#5931
parent
e671070a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
servers/slapd/back-ldap/search.c
+31
-6
31 additions, 6 deletions
servers/slapd/back-ldap/search.c
servers/slapd/back-meta/search.c
+74
-14
74 additions, 14 deletions
servers/slapd/back-meta/search.c
with
105 additions
and
20 deletions
servers/slapd/back-ldap/search.c
+
31
−
6
View file @
2f02920b
...
...
@@ -424,10 +424,34 @@ retry:
}
}
else
if
(
rc
==
LDAP_RES_INTERMEDIATE
)
{
Debug
(
LDAP_DEBUG_ANY
,
"%s ldap_back_search: "
"intermediate response not supported yet.
\n
"
,
op
->
o_log_prefix
,
0
,
0
);
/* FIXME: response controls
* are passed without checks */
rc
=
ldap_parse_intermediate
(
lc
->
lc_ld
,
res
,
&
rs
->
sr_rspoid
,
&
rs
->
sr_rspdata
,
&
rs
->
sr_ctrls
,
0
);
if
(
rc
!=
LDAP_SUCCESS
)
{
continue
;
}
slap_send_ldap_intermediate
(
op
,
rs
);
if
(
rs
->
sr_rspoid
!=
NULL
)
{
ber_memfree
(
rs
->
sr_rspoid
);
rs
->
sr_rspoid
=
NULL
;
}
if
(
rs
->
sr_rspdata
!=
NULL
)
{
ber_bvfree
(
rs
->
sr_rspdata
);
rs
->
sr_rspdata
=
NULL
;
}
if
(
rs
->
sr_ctrls
!=
NULL
)
{
ldap_controls_free
(
rs
->
sr_ctrls
);
rs
->
sr_ctrls
=
NULL
;
}
}
else
{
char
*
err
=
NULL
;
...
...
@@ -646,7 +670,7 @@ ldap_build_entry(
attr
=
attr_alloc
(
NULL
);
if
(
attr
==
NULL
)
{
continue
;
return
LDAP_OTHER
;
}
if
(
slap_bv2ad
(
&
a
,
&
attr
->
a_desc
,
&
text
)
!=
LDAP_SUCCESS
)
...
...
@@ -658,6 +682,8 @@ ldap_build_entry(
"%s ldap_build_entry: "
"slap_bv2undef_ad(%s): %s
\n
"
,
op
->
o_log_prefix
,
a
.
bv_val
,
text
);
(
void
)
ber_scanf
(
&
ber
,
"x"
/* [W] */
);
attr_free
(
attr
);
continue
;
}
...
...
@@ -680,7 +706,6 @@ ldap_build_entry(
* present...
*/
(
void
)
ber_scanf
(
&
ber
,
"x"
/* [W] */
);
attr_free
(
attr
);
continue
;
}
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-meta/search.c
+
74
−
14
View file @
2f02920b
...
...
@@ -1212,6 +1212,44 @@ really_bad:;
rs
->
sr_ctrls
=
NULL
;
}
}
else
if
(
rc
==
LDAP_RES_INTERMEDIATE
)
{
if
(
candidates
[
i
].
sr_type
==
REP_INTERMEDIATE
)
{
/* don't retry any more... */
candidates
[
i
].
sr_type
=
REP_RESULT
;
}
/* FIXME: response controls
* are passed without checks */
rs
->
sr_err
=
ldap_parse_intermediate
(
msc
->
msc_ld
,
msg
,
&
rs
->
sr_rspoid
,
&
rs
->
sr_rspdata
,
&
rs
->
sr_ctrls
,
0
);
if
(
rs
->
sr_err
!=
LDAP_SUCCESS
)
{
candidates
[
i
].
sr_type
=
REP_RESULT
;
ldap_msgfree
(
res
);
res
=
NULL
;
goto
really_bad
;
}
slap_send_ldap_intermediate
(
op
,
rs
);
if
(
rs
->
sr_rspoid
!=
NULL
)
{
ber_memfree
(
rs
->
sr_rspoid
);
rs
->
sr_rspoid
=
NULL
;
}
if
(
rs
->
sr_rspdata
!=
NULL
)
{
ber_bvfree
(
rs
->
sr_rspdata
);
rs
->
sr_rspdata
=
NULL
;
}
if
(
rs
->
sr_ctrls
!=
NULL
)
{
ldap_controls_free
(
rs
->
sr_ctrls
);
rs
->
sr_ctrls
=
NULL
;
}
}
else
if
(
rc
==
LDAP_RES_SEARCH_RESULT
)
{
char
buf
[
SLAP_TEXT_BUFLEN
];
char
**
references
=
NULL
;
...
...
@@ -1412,16 +1450,6 @@ really_bad:;
assert
(
ncandidates
>
0
);
--
ncandidates
;
}
else
if
(
rc
==
LDAP_RES_INTERMEDIATE
)
{
/* TODO: ITS#5931 */
/* ignore right now */
Debug
(
LDAP_DEBUG_ANY
,
"%s meta_back_search[%ld]: "
"intermediate response message not supported yet.
\n
"
,
op
->
o_log_prefix
,
i
,
0
);
}
else
if
(
rc
==
LDAP_RES_BIND
)
{
meta_search_candidate_t
retcode
;
...
...
@@ -1780,9 +1808,19 @@ meta_send_entry(
dn
=
BER_BVNULL
;
const
char
*
text
;
dncookie
dc
;
ber_len_t
len
;
ber_tag_t
tag
;
int
rc
;
if
(
ber_scanf
(
&
ber
,
"{m{"
,
&
bdn
)
==
LBER_ERROR
)
{
if
(
ber_scanf
(
&
ber
,
"l{"
,
&
len
)
==
LBER_ERROR
)
{
return
LDAP_DECODING_ERROR
;
}
if
(
ber_set_option
(
&
ber
,
LBER_OPT_REMAINING_BYTES
,
&
len
)
!=
LBER_OPT_SUCCESS
)
{
return
LDAP_OTHER
;
}
if
(
ber_scanf
(
&
ber
,
"m{"
,
&
bdn
)
==
LBER_ERROR
)
{
return
LDAP_DECODING_ERROR
;
}
...
...
@@ -1814,7 +1852,12 @@ meta_send_entry(
BER_BVZERO
(
&
dn
);
if
(
rc
!=
LDAP_SUCCESS
)
{
return
LDAP_INVALID_DN_SYNTAX
;
Debug
(
LDAP_DEBUG_ANY
,
"%s meta_send_entry(
\"
%s
\"
): "
"invalid DN syntax
\n
"
,
op
->
o_log_prefix
,
ent
.
e_name
.
bv_val
,
0
);
rc
=
LDAP_INVALID_DN_SYNTAX
;
goto
done
;
}
/*
...
...
@@ -1833,6 +1876,20 @@ meta_send_entry(
slap_syntax_validate_func
*
validate
;
slap_syntax_transform_func
*
pretty
;
if
(
ber_pvt_ber_remaining
(
&
ber
)
<
0
)
{
Debug
(
LDAP_DEBUG_ANY
,
"%s meta_send_entry(
\"
%s
\"
): "
"unable to parse attr
\"
%s
\"
.
\n
"
,
op
->
o_log_prefix
,
ent
.
e_name
.
bv_val
,
a
.
bv_val
);
rc
=
LDAP_OTHER
;
goto
done
;
}
if
(
ber_pvt_ber_remaining
(
&
ber
)
==
0
)
{
break
;
}
ldap_back_map
(
&
mi
->
mi_targets
[
target
]
->
mt_rwmap
.
rwm_at
,
&
a
,
&
mapped
,
BACKLDAP_REMAP
);
if
(
BER_BVISNULL
(
&
mapped
)
||
mapped
.
bv_val
[
0
]
==
'\0'
)
{
...
...
@@ -1845,7 +1902,8 @@ meta_send_entry(
}
attr
=
attr_alloc
(
NULL
);
if
(
attr
==
NULL
)
{
continue
;
rc
=
LDAP_OTHER
;
goto
done
;
}
if
(
slap_bv2ad
(
&
mapped
,
&
attr
->
a_desc
,
&
text
)
!=
LDAP_SUCCESS
)
{
...
...
@@ -1861,6 +1919,7 @@ meta_send_entry(
mapped
.
bv_val
,
text
);
Debug
(
LDAP_DEBUG_ANY
,
"%s"
,
buf
,
0
,
0
);
(
void
)
ber_scanf
(
&
ber
,
"x"
/* [W] */
);
attr_free
(
attr
);
continue
;
}
...
...
@@ -1883,7 +1942,6 @@ meta_send_entry(
* present...
*/
(
void
)
ber_scanf
(
&
ber
,
"x"
/* [W] */
);
attr_free
(
attr
);
continue
;
}
...
...
@@ -2097,6 +2155,8 @@ next_attr:;
rc
=
LDAP_OTHER
;
break
;
}
done:
;
rs
->
sr_entry
=
NULL
;
rs
->
sr_attrs
=
NULL
;
if
(
rs
->
sr_ctrls
!=
NULL
)
{
...
...
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