Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
c2978164
Commit
c2978164
authored
Apr 16, 2010
by
Quanah Gibson-Mount
Browse files
allow to look-ahead entry DN without decoding the whole entry (ITS#6442)
parent
eb4761c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
servers/slapd/entry.c
View file @
c2978164
...
...
@@ -820,6 +820,35 @@ int entry_header(EntryHeader *eh)
return
LDAP_SUCCESS
;
}
int
entry_decode_dn
(
EntryHeader
*
eh
,
struct
berval
*
dn
,
struct
berval
*
ndn
)
{
int
i
;
unsigned
char
*
ptr
=
(
unsigned
char
*
)
eh
->
bv
.
bv_val
;
assert
(
dn
!=
NULL
||
ndn
!=
NULL
);
ptr
=
(
unsigned
char
*
)
eh
->
data
;
i
=
entry_getlen
(
&
ptr
);
if
(
dn
!=
NULL
)
{
dn
->
bv_val
=
(
char
*
)
ptr
;
dn
->
bv_len
=
i
;
}
if
(
ndn
!=
NULL
)
{
ptr
+=
i
+
1
;
i
=
entry_getlen
(
&
ptr
);
ndn
->
bv_val
=
(
char
*
)
ptr
;
ndn
->
bv_len
=
i
;
}
Debug
(
LDAP_DEBUG_TRACE
,
"entry_decode_dn:
\"
%s
\"\n
"
,
dn
?
dn
->
bv_val
:
ndn
->
bv_val
,
0
,
0
);
return
0
;
}
#ifdef SLAP_ZONE_ALLOC
int
entry_decode
(
EntryHeader
*
eh
,
Entry
**
e
,
void
*
ctx
)
#else
...
...
servers/slapd/proto-slap.h
View file @
c2978164
...
...
@@ -985,6 +985,8 @@ LDAP_SLAPD_F (void) entry_partsize LDAP_P(( Entry *e, ber_len_t *len,
int
*
nattrs
,
int
*
nvals
,
int
norm
));
LDAP_SLAPD_F
(
int
)
entry_header
LDAP_P
((
EntryHeader
*
eh
));
LDAP_SLAPD_F
(
int
)
entry_decode_dn
LDAP_P
((
EntryHeader
*
eh
,
struct
berval
*
dn
,
struct
berval
*
ndn
));
#ifdef SLAP_ZONE_ALLOC
LDAP_SLAPD_F
(
int
)
entry_decode
LDAP_P
((
EntryHeader
*
eh
,
Entry
**
e
,
void
*
ctx
));
...
...
servers/slapd/slap.h
View file @
c2978164
...
...
@@ -1592,6 +1592,12 @@ LDAP_SLAPD_V (int) slapMode;
#define SB_TLS_ON 1
#define SB_TLS_CRITICAL 2
typedef
struct
slap_keepalive
{
int
sk_idle
;
int
sk_probes
;
int
sk_interval
;
}
slap_keepalive
;
typedef
struct
slap_bindconf
{
struct
berval
sb_uri
;
int
sb_version
;
...
...
@@ -1606,6 +1612,7 @@ typedef struct slap_bindconf {
struct
berval
sb_realm
;
struct
berval
sb_authcId
;
struct
berval
sb_authzId
;
slap_keepalive
sb_keepalive
;
#ifdef HAVE_TLS
void
*
sb_tls_ctx
;
char
*
sb_tls_cert
;
...
...
@@ -1635,6 +1642,14 @@ typedef struct slap_cf_aux_table {
void
*
aux
;
}
slap_cf_aux_table
;
typedef
int
slap_cf_aux_table_parse_x
LDAP_P
((
struct
berval
*
val
,
void
*
bc
,
slap_cf_aux_table
*
tab0
,
const
char
*
tabmsg
,
int
unparse
));
typedef
int
slap_cf_aux_table_parse_x
LDAP_P
((
struct
berval
*
val
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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