Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
9204476b
Commit
9204476b
authored
Sep 29, 2007
by
Howard Chu
Browse files
ITS
#5138
from HEAD - controls, slab allocation
parent
25b997c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/back-ldap/search.c
View file @
9204476b
...
...
@@ -603,12 +603,14 @@ ldap_build_entry(
Attribute
*
attr
,
**
attrp
;
const
char
*
text
;
int
last
;
char
*
lastb
;
ber_len_t
len
;
/* safe assumptions ... */
assert
(
ent
!=
NULL
);
BER_BVZERO
(
&
ent
->
e_bv
);
if
(
ber_scanf
(
&
ber
,
"{m
{
"
,
bdn
)
==
LBER_ERROR
)
{
if
(
ber_scanf
(
&
ber
,
"{m"
,
bdn
)
==
LBER_ERROR
)
{
return
LDAP_DECODING_ERROR
;
}
...
...
@@ -628,9 +630,14 @@ ldap_build_entry(
return
LDAP_INVALID_DN_SYNTAX
;
}
attrp
=
&
ent
->
e_attrs
;
ent
->
e_attrs
=
NULL
;
if
(
ber_first_element
(
&
ber
,
&
len
,
&
lastb
)
!=
LBER_SEQUENCE
)
{
return
LDAP_SUCCESS
;
}
while
(
ber_scanf
(
&
ber
,
"{m"
,
&
a
)
!=
LBER_ERROR
)
{
attrp
=
&
ent
->
e_attrs
;
while
(
ber_next_element
(
&
ber
,
&
len
,
lastb
)
==
LBER_SEQUENCE
&&
ber_scanf
(
&
ber
,
"{m"
,
&
a
)
!=
LBER_ERROR
)
{
int
i
;
slap_syntax_validate_func
*
validate
;
slap_syntax_transform_func
*
pretty
;
...
...
@@ -826,9 +833,9 @@ ldap_back_entry_get(
if
(
oc
)
{
char
*
ptr
;
filter
=
ch_m
alloc
(
STRLENOF
(
"(object
c
lass=)"
)
+
oc
->
soc_cname
.
bv_len
+
1
);
ptr
=
lutil_strcopy
(
filter
,
"(object
c
lass="
);
filter
=
op
->
o_tmp
alloc
(
STRLENOF
(
"(object
C
lass=
"
"
)"
)
+
oc
->
soc_cname
.
bv_len
+
1
,
op
->
o_tmpmemctx
);
ptr
=
lutil_strcopy
(
filter
,
"(object
C
lass="
);
ptr
=
lutil_strcopy
(
ptr
,
oc
->
soc_cname
.
bv_val
);
*
ptr
++
=
')'
;
*
ptr
++
=
'\0'
;
...
...
@@ -841,7 +848,8 @@ retry:
if
(
rc
!=
LDAP_SUCCESS
)
{
goto
cleanup
;
}
/* TODO: timeout? */
rc
=
ldap_search_ext_s
(
lc
->
lc_ld
,
ndn
->
bv_val
,
LDAP_SCOPE_BASE
,
filter
,
attrp
,
0
,
ctrls
,
NULL
,
NULL
,
LDAP_NO_LIMIT
,
&
result
);
...
...
@@ -884,7 +892,7 @@ cleanup:
}
if
(
filter
)
{
ch_
free
(
filter
);
op
->
o_tmp
free
(
filter
,
op
->
o_tmpmemctx
);
}
if
(
lc
!=
NULL
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment