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
Lukas However
OpenLDAP
Commits
3e5a2904
Commit
3e5a2904
authored
20 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
bdb_tool_dn2id_get should use bdb_dn2id, not duplicate the code
parent
70f375ea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/back-bdb/tools.c
+10
-26
10 additions, 26 deletions
servers/slapd/back-bdb/tools.c
with
10 additions
and
26 deletions
servers/slapd/back-bdb/tools.c
+
10
−
26
View file @
3e5a2904
...
...
@@ -138,34 +138,18 @@ ID bdb_tool_dn2id_get(
struct
berval
*
dn
)
{
struct
bdb_info
*
bdb
=
(
struct
bdb_info
*
)
be
->
be_private
;
DB
*
db
=
bdb
->
bi_dn2id
->
bdi_db
;
int
rc
;
DBT
key
,
data
;
ID
id
;
DBTzero
(
&
key
);
key
.
size
=
dn
->
bv_len
+
2
;
key
.
data
=
ch_malloc
(
key
.
size
);
((
char
*
)
key
.
data
)[
0
]
=
DN_BASE_PREFIX
;
AC_MEMCPY
(
&
((
char
*
)
key
.
data
)[
1
],
dn
->
bv_val
,
key
.
size
-
1
);
DBTzero
(
&
data
);
data
.
data
=
&
id
;
data
.
ulen
=
sizeof
(
ID
);
data
.
flags
=
DB_DBT_USERMEM
;
rc
=
db
->
get
(
db
,
NULL
,
&
key
,
&
data
,
bdb
->
bi_db_opflags
);
Operation
op
=
{
0
};
Opheader
ohdr
=
{
0
};
EntryInfo
ei
=
{
0
};
if
(
rc
!=
0
)
{
Debug
(
LDAP_DEBUG_TRACE
,
LDAP_XSTRING
(
bdb_tool_dn2id_get
)
": get failed: %s (%d)
\n
"
,
db_strerror
(
rc
),
rc
,
0
);
id
=
NOID
;
}
op
.
o_hdr
=
&
ohdr
;
op
.
o_bd
=
be
;
op
.
o_tmpmemctx
=
NULL
;
op
.
o_tmpmfuncs
=
&
ch_mfuncs
;
ch_free
(
key
.
data
);
return
id
;
bdb_dn2id
(
&
op
,
NULL
,
dn
,
&
ei
);
return
ei
.
bei_id
;
}
int
bdb_tool_id2entry_get
(
...
...
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