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
fbe63f47
Commit
fbe63f47
authored
Jul 12, 1999
by
Kurt Zeilenga
Browse files
Fix bugs in last commit. LDBM Tests 0 - 4 now work.
parent
c3ffaa71
Changes
2
Hide whitespace changes
Inline
Side-by-side
servers/slapd/back-ldbm/search.c
View file @
fbe63f47
...
...
@@ -180,13 +180,13 @@ ldbm_back_search(
break
;
#endif
default:
e
=
d
n
2entry_r
(
be
,
base
,
&
matche
d
);
e
=
i
d2entry_r
(
be
,
i
d
);
err
=
e
!=
NULL
?
LDAP_SUCCESS
:
LDAP_REFERRAL
;
}
if
(
e
==
NULL
)
{
Debug
(
LDAP_DEBUG_ARGS
,
"candidate %ld not found
\n
"
,
id
,
0
,
0
);
id
,
0
,
0
);
continue
;
}
...
...
@@ -214,7 +214,7 @@ ldbm_back_search(
/* check scope */
if
(
scope
==
LDAP_SCOPE_ONELEVEL
)
{
if
(
(
dn
=
dn_parent
(
be
,
e
->
e_dn
))
!=
NULL
)
{
if
(
(
dn
=
dn_parent
(
be
,
e
->
e_
n
dn
))
!=
NULL
)
{
(
void
)
dn_normalize_case
(
dn
);
scopeok
=
(
dn
==
matched_dn
)
?
1
...
...
@@ -260,7 +260,13 @@ ldbm_back_search(
return
(
0
);
}
}
}
else
{
Debug
(
LDAP_DEBUG_TRACE
,
"candidate %ld scope not okay
\n
"
,
id
,
0
,
0
);
}
}
else
{
Debug
(
LDAP_DEBUG_TRACE
,
"candidate %ld does match filter
\n
"
,
id
,
0
,
0
);
}
}
...
...
@@ -313,8 +319,8 @@ search_candidates(
ID_BLOCK
*
candidates
;
Filter
*
f
,
*
rf
,
*
af
,
*
lf
;
Debug
(
LDAP_DEBUG_TRACE
,
"search_candidates: base
:
\"
%s
\"
%
s
\n
"
,
e
->
e_dn
,
0
,
0
);
Debug
(
LDAP_DEBUG_TRACE
,
"search_candidates: base
=
\"
%s
\"
s
=%d d=%d
\n
"
,
e
->
e_dn
,
scope
,
deref
);
f
=
NULL
;
...
...
@@ -335,6 +341,7 @@ search_candidates(
f
=
filter
;
}
#ifdef SLAPD_ALIASES
if
(
deref
==
LDAP_DEREF_SEARCHING
||
deref
==
LDAP_DEREF_ALWAYS
)
{
/* match aliases */
af
=
(
Filter
*
)
ch_malloc
(
sizeof
(
Filter
)
);
...
...
@@ -350,35 +357,53 @@ search_candidates(
}
else
{
af
=
NULL
;
}
#else
af
=
NULL
;
#endif
l
f
=
(
Filter
*
)
ch_malloc
(
sizeof
(
Filter
)
)
;
lf
->
f_next
=
NULL
;
lf
->
f_
choice
=
LDAP_FILTER_AND
;
lf
->
f_
and
=
(
Filter
*
)
ch_malloc
(
sizeof
(
Filter
)
)
;
lf
->
f_and
->
f_next
=
f
;
i
f
(
scope
==
LDAP_SCOPE_SUBTREE
&&
!
be_issuffix
(
be
,
e
->
e_ndn
)
)
{
lf
=
(
Filter
*
)
ch_malloc
(
sizeof
(
Filter
)
)
;
lf
->
f_
next
=
NULL
;
lf
->
f_
choice
=
LDAP_FILTER_AND
;
lf
->
f_and
=
(
Filter
*
)
ch_malloc
(
sizeof
(
Filter
)
)
;
if
(
scope
==
LDAP_SCOPE_SUBTREE
)
{
lf
->
f_and
->
f_choice
=
LDAP_FILTER_SUBSTRINGS
;
lf
->
f_and
->
f_sub_type
=
ch_strdup
(
"dn"
);
lf
->
f_and
->
f_sub_initial
=
NULL
;
lf
->
f_and
->
f_sub_any
=
NULL
;
lf
->
f_and
->
f_sub_final
=
ch_strdup
(
e
->
e_ndn
);
value_normalize
(
lf
->
f_and
->
f_sub_final
,
SYNTAX_DN
|
SYNTAX_CIS
);
}
else
{
lf
->
f_and
->
f_next
=
f
;
f
=
lf
;
}
else
if
(
scope
==
LDAP_SCOPE_ONELEVEL
)
{
char
buf
[
16
];
lf
=
(
Filter
*
)
ch_malloc
(
sizeof
(
Filter
)
);
lf
->
f_next
=
NULL
;
lf
->
f_choice
=
LDAP_FILTER_AND
;
lf
->
f_and
=
(
Filter
*
)
ch_malloc
(
sizeof
(
Filter
)
);
lf
->
f_and
->
f_choice
=
LDAP_FILTER_EQUALITY
;
lf
->
f_and
->
f_ava
.
ava_type
=
ch_strdup
(
"id2children"
);
sprintf
(
buf
,
"%ld"
,
e
!=
NULL
?
e
->
e_id
:
0
);
lf
->
f_and
->
f_ava
.
ava_value
.
bv_val
=
ch_strdup
(
buf
);
lf
->
f_and
->
f_ava
.
ava_value
.
bv_len
=
strlen
(
buf
);
lf
->
f_and
->
f_next
=
f
;
f
=
lf
;
}
else
{
lf
=
NULL
;
}
candidates
=
filter_candidates
(
be
,
l
f
);
candidates
=
filter_candidates
(
be
,
f
);
/* free up filter additions we allocated above */
lf
->
f_and
->
f_next
=
NULL
;
filter_free
(
lf
);
if
(
lf
!=
NULL
)
{
lf
->
f_and
->
f_next
=
NULL
;
filter_free
(
lf
);
}
if
(
af
!=
NULL
)
{
af
->
f_or
->
f_next
=
NULL
;
...
...
servers/slapd/result.c
View file @
fbe63f47
...
...
@@ -73,10 +73,10 @@ static void trim_refs_urls(
struct
berval
**
refs
)
{
unsigned
i
;
assert
(
refs
!=
NULL
);
for
(
i
=
0
;
refs
[
i
]
!=
NULL
;
i
++
)
{
if
(
refs
==
NULL
)
return
;
for
(
i
=
0
;
refs
[
i
]
!=
NULL
;
i
++
)
{
if
(
refs
[
i
]
->
bv_len
>
sizeof
(
"ldap://"
)
&&
strncasecmp
(
refs
[
i
]
->
bv_val
,
"ldap://"
,
sizeof
(
"ldap://"
)
-
1
)
==
0
)
...
...
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