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
d1803fce
Commit
d1803fce
authored
25 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Fix multivalued indices. Need to add indices of remaining
values after delete of any value.
parent
404ca4a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
servers/slapd/back-ldbm/index.c
+0
-51
0 additions, 51 deletions
servers/slapd/back-ldbm/index.c
servers/slapd/back-ldbm/modify.c
+74
-24
74 additions, 24 deletions
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/proto-back-ldbm.h
+0
-1
0 additions, 1 deletion
servers/slapd/back-ldbm/proto-back-ldbm.h
with
74 additions
and
76 deletions
servers/slapd/back-ldbm/index.c
+
0
−
51
View file @
d1803fce
...
...
@@ -77,57 +77,6 @@ index_add_entry(
return
(
0
);
}
int
index_add_mods
(
Backend
*
be
,
Modifications
*
ml
,
ID
id
)
{
int
rc
;
for
(
;
ml
!=
NULL
;
ml
=
ml
->
sml_next
)
{
Modification
*
mod
=
&
ml
->
sml_mod
;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
/* not yet implemented */
rc
=
-
1
;
#else
switch
(
mod
->
mod_op
)
{
case
LDAP_MOD_REPLACE
:
/* XXX: Delete old index data==>problem when this
* gets called we lost values already!
*/
case
LDAP_MOD_ADD
:
rc
=
index_change_values
(
be
,
mod
->
mod_type
,
mod
->
mod_bvalues
,
id
,
SLAP_INDEX_ADD_OP
);
break
;
case
LDAP_MOD_DELETE
:
rc
=
index_change_values
(
be
,
mod
->
mod_type
,
mod
->
mod_bvalues
,
id
,
SLAP_INDEX_DELETE_OP
);
break
;
case
SLAP_MOD_SOFTADD
:
/* SOFTADD means index was there */
rc
=
0
;
break
;
default:
rc
=
-
1
;
}
#endif
if
(
rc
!=
0
)
{
return
(
rc
);
}
}
return
(
0
);
}
ID_BLOCK
*
index_read
(
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-ldbm/modify.c
+
74
−
24
View file @
d1803fce
...
...
@@ -127,39 +127,89 @@ int ldbm_modify_internal(
}
ldap_pvt_thread_mutex_unlock
(
&
op
->
o_abandonmutex
);
/* remov
e
old indices */
if
(
save_attrs
!=
NULL
)
{
for
(
ml
=
modlist
;
ml
!=
NULL
;
ml
=
ml
->
sml_next
)
{
mod
=
&
ml
->
sml_mod
;
/*
run through the attributes
remov
ing
old indices */
for
(
ml
=
modlist
;
ml
!=
NULL
;
ml
=
ml
->
sml_next
)
{
mod
=
&
ml
->
sml_mod
;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
if
(
mod
->
sm_op
==
LDAP_MOD_REPLACE
)
switch
(
mod
->
sm_op
)
#else
if
(
mod
->
mod_op
==
LDAP_MOD_REPLACE
)
switch
(
mod
->
mod_op
)
#endif
{
{
case
LDAP_MOD_REPLACE
:
{
#ifdef SLAPD_SCHEMA_NOT_COMPAT
/* not yet implemented */
/* not yet implemented */
#else
/* Need to remove all values from indexes */
Attribute
*
a
=
attr_find
(
save_attrs
,
mod
->
mod_type
);
if
(
a
!=
NULL
)
{
(
void
)
index_change_values
(
be
,
mod
->
mod_type
,
a
->
a_vals
,
e
->
e_id
,
SLAP_INDEX_DELETE_OP
);
}
#endif
/* Need to remove all values from indexes */
Attribute
*
a
=
save_attrs
?
attr_find
(
save_attrs
,
mod
->
mod_type
)
:
NULL
;
if
(
a
!=
NULL
)
{
(
void
)
index_change_values
(
be
,
mod
->
mod_type
,
a
->
a_vals
,
e
->
e_id
,
SLAP_INDEX_DELETE_OP
);
}
#endif
}
break
;
case
LDAP_MOD_DELETE
:
#ifdef SLAPD_SCHEMA_NOT_COMPAT
/* not yet implemented */
#else
/* remove deleted values */
(
void
)
index_change_values
(
be
,
mod
->
mod_type
,
mod
->
mod_bvalues
,
e
->
e_id
,
SLAP_INDEX_DELETE_OP
);
#endif
break
;
}
attrs_free
(
save_attrs
);
}
/* modify indexes */
if
(
index_add_mods
(
be
,
modlist
,
e
->
e_id
)
!=
0
)
{
/* our indices are likely hosed */
return
LDAP_OTHER
;
attrs_free
(
save_attrs
);
/* run through the attributes adding new indices */
for
(
ml
=
modlist
;
ml
!=
NULL
;
ml
=
ml
->
sml_next
)
{
mod
=
&
ml
->
sml_mod
;
switch
(
mod
->
mod_op
)
{
case
LDAP_MOD_REPLACE
:
case
LDAP_MOD_ADD
:
#ifdef SLAPD_SCHEMA_NOT_COMPAT
/* not yet implemented */
#else
(
void
)
index_change_values
(
be
,
mod
->
mod_type
,
mod
->
mod_bvalues
,
e
->
e_id
,
SLAP_INDEX_ADD_OP
);
#endif
break
;
case
LDAP_MOD_DELETE
:
{
#ifdef SLAPD_SCHEMA_NOT_COMPAT
/* not yet implemented */
#else
/* Need to add all remaining values */
Attribute
*
a
=
e
->
e_attrs
?
attr_find
(
e
->
e_attrs
,
mod
->
mod_type
)
:
NULL
;
#endif
if
(
a
!=
NULL
)
{
(
void
)
index_change_values
(
be
,
mod
->
mod_type
,
a
->
a_vals
,
e
->
e_id
,
SLAP_INDEX_ADD_OP
);
}
}
break
;
}
}
return
LDAP_SUCCESS
;
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-ldbm/proto-back-ldbm.h
+
0
−
1
View file @
d1803fce
...
...
@@ -132,7 +132,6 @@ ID idl_nextid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
*/
int
index_add_entry
LDAP_P
((
Backend
*
be
,
Entry
*
e
));
int
index_add_mods
LDAP_P
((
Backend
*
be
,
Modifications
*
ml
,
ID
id
));
ID_BLOCK
*
index_read
LDAP_P
((
Backend
*
be
,
char
*
type
,
int
indextype
,
char
*
val
));
/* Possible operations supported (op) by index_change_values() */
...
...
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