Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
Christopher Ng
OpenLDAP
Commits
cc361f7a
Commit
cc361f7a
authored
19 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
don't need compare if entry_get is available
parent
61f11773
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/back-ldif/ldif.c
+26
-32
26 additions, 32 deletions
servers/slapd/back-ldif/ldif.c
with
26 additions
and
32 deletions
servers/slapd/back-ldif/ldif.c
+
26
−
32
View file @
cc361f7a
...
...
@@ -685,10 +685,10 @@ ldif_back_referrals( Operation *op, SlapReply *rs )
rs
->
sr_matched
=
NULL
;
ber_bvarray_free
(
refs
);
entry_free
(
entry
);
}
entry_free
(
entry
);
return
rc
;
}
...
...
@@ -1009,39 +1009,25 @@ static int ldif_back_modrdn(Operation *op, SlapReply *rs) {
return
0
;
}
static
int
ldif_back_compare
(
Operation
*
op
,
SlapReply
*
rs
)
{
/* return LDAP_SUCCESS IFF we can retrieve the specified entry.
*/
int
ldif_back_entry_get
(
Operation
*
op
,
struct
berval
*
ndn
,
ObjectClass
*
oc
,
AttributeDescription
*
at
,
int
rw
,
Entry
**
ent
)
{
struct
ldif_info
*
ni
=
(
struct
ldif_info
*
)
op
->
o_bd
->
be_private
;
Entry
*
e
=
NULL
;
Attribute
*
a
;
ldap_pvt_thread_mutex_lock
(
&
ni
->
li_mutex
);
ldap_pvt_thread_mutex_lock
(
&
ni
->
li_mutex
);
e
=
(
Entry
*
)
get_entry
(
op
,
&
ni
->
li_base_path
);
if
(
e
!=
NULL
)
{
for
(
a
=
attrs_find
(
e
->
e_attrs
,
op
->
oq_compare
.
rs_ava
->
aa_desc
);
a
!=
NULL
;
a
=
attrs_find
(
a
->
a_next
,
op
->
oq_compare
.
rs_ava
->
aa_desc
))
{
rs
->
sr_err
=
LDAP_COMPARE_FALSE
;
if
(
value_find_ex
(
op
->
oq_compare
.
rs_ava
->
aa_desc
,
SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH
|
SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH
,
a
->
a_nvals
,
&
op
->
oq_compare
.
rs_ava
->
aa_value
,
op
->
o_tmpmemctx
)
==
0
)
{
rs
->
sr_err
=
LDAP_COMPARE_TRUE
;
break
;
}
}
}
else
{
rs
->
sr_err
=
LDAP_NO_SUCH_OBJECT
;
}
*
ent
=
(
Entry
*
)
get_entry
(
op
,
&
ni
->
li_base_path
);
if
(
e
!=
NULL
)
entry_free
(
e
);
ldap_pvt_thread_mutex_unlock
(
&
ni
->
li_mutex
);
send_ldap_result
(
op
,
rs
);
return
0
;
ldap_pvt_thread_mutex_unlock
(
&
ni
->
li_mutex
);
return
(
*
ent
==
NULL
?
1
:
0
);
}
static
int
ldif_tool_entry_open
(
BackendDB
*
be
,
int
mode
)
{
...
...
@@ -1221,7 +1207,7 @@ ldif_back_initialize(
bi
->
bi_op_bind
=
ldif_back_bind
;
bi
->
bi_op_unbind
=
0
;
bi
->
bi_op_search
=
ldif_back_search
;
bi
->
bi_op_compare
=
ldif_back_compare
;
bi
->
bi_op_compare
=
0
;
bi
->
bi_op_modify
=
ldif_back_modify
;
bi
->
bi_op_modrdn
=
ldif_back_modrdn
;
bi
->
bi_op_add
=
ldif_back_add
;
...
...
@@ -1235,6 +1221,14 @@ ldif_back_initialize(
bi
->
bi_connection_init
=
0
;
bi
->
bi_connection_destroy
=
0
;
bi
->
bi_entry_get_rw
=
ldif_back_entry_get
;
#if 0 /* NOTE: uncomment to completely disable access control */
#ifdef SLAP_OVERLAY_ACCESS
bi->bi_access_allowed = slap_access_always_allowed;
#endif /* SLAP_OVERLAY_ACCESS */
#endif
bi
->
bi_tool_entry_open
=
ldif_tool_entry_open
;
bi
->
bi_tool_entry_close
=
ldif_tool_entry_close
;
bi
->
bi_tool_entry_first
=
ldif_tool_entry_first
;
...
...
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