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
James Lowden
OpenLDAP
Commits
e237f4cc
Commit
e237f4cc
authored
17 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Re-introduce hdb dup_compare function, default compares too much
parent
f06fdb28
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-bdb/dn2id.c
+25
-0
25 additions, 0 deletions
servers/slapd/back-bdb/dn2id.c
servers/slapd/back-bdb/init.c
+2
-0
2 additions, 0 deletions
servers/slapd/back-bdb/init.c
servers/slapd/back-bdb/proto-bdb.h
+6
-0
6 additions, 0 deletions
servers/slapd/back-bdb/proto-bdb.h
with
33 additions
and
0 deletions
servers/slapd/back-bdb/dn2id.c
+
25
−
0
View file @
e237f4cc
...
...
@@ -451,6 +451,31 @@ typedef struct diskNode {
unsigned
char
entryID
[
sizeof
(
ID
)];
/* variable placement */
}
diskNode
;
/* Sort function for the sorted duplicate data items of a dn2id key.
* Sorts based on normalized RDN, in length order.
*/
int
hdb_dup_compare
(
DB
*
db
,
const
DBT
*
usrkey
,
const
DBT
*
curkey
)
{
diskNode
*
un
,
*
cn
;
int
rc
,
ul
,
cl
;
un
=
(
diskNode
*
)
usrkey
->
data
;
cn
=
(
diskNode
*
)
curkey
->
data
;
/* data is not aligned, cannot compare directly */
ul
=
un
->
nrdnlen
[
0
]
<<
8
|
un
->
nrdnlen
[
1
];
cl
=
cn
->
nrdnlen
[
0
]
<<
8
|
cn
->
nrdnlen
[
1
];
rc
=
ul
-
cl
;
if
(
rc
)
return
rc
;
return
strcmp
(
un
->
nrdn
,
cn
->
nrdn
);
}
/* This function constructs a full DN for a given entry.
*/
int
hdb_fix_dn
(
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-bdb/init.c
+
2
−
0
View file @
e237f4cc
...
...
@@ -412,6 +412,8 @@ shm_retry:
flags
|=
DB_CREATE
;
}
#else
rc
=
db
->
bdi_db
->
set_dup_compare
(
db
->
bdi_db
,
bdb_dup_compare
);
if
(
slapMode
&
(
SLAP_TOOL_READONLY
|
SLAP_TOOL_READMAIN
)
)
{
flags
|=
DB_RDONLY
;
}
else
{
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-bdb/proto-bdb.h
+
6
−
0
View file @
e237f4cc
...
...
@@ -129,6 +129,7 @@ int bdb_dn2idl(
#ifdef BDB_HIER
#define bdb_dn2id_parent BDB_SYMBOL(dn2id_parent)
#define bdb_dup_compare BDB_SYMBOL(dup_compare)
#define bdb_fix_dn BDB_SYMBOL(fix_dn)
int
bdb_dn2id_parent
(
...
...
@@ -137,6 +138,11 @@ int bdb_dn2id_parent(
EntryInfo
*
ei
,
ID
*
idp
);
int
bdb_dup_compare
(
DB
*
db
,
const
DBT
*
usrkey
,
const
DBT
*
curkey
);
int
bdb_fix_dn
(
Entry
*
e
,
int
checkit
);
#endif
...
...
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