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
openldap
OpenLDAP
Commits
79698410
Commit
79698410
authored
May 07, 2004
by
Pierangelo Masarati
Browse files
allow LDAPv2 DN to be enclosed in <>
parent
891fef5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/libldap/getdn.c
View file @
79698410
...
...
@@ -713,7 +713,7 @@ ldap_bv2dn( struct berval *bv, LDAPDN *dn, unsigned flags )
}
int
ldap_bv2dn_x
(
struct
berval
*
bv
,
LDAPDN
*
dn
,
unsigned
flags
,
void
*
ctx
)
ldap_bv2dn_x
(
struct
berval
*
bv
in
,
LDAPDN
*
dn
,
unsigned
flags
,
void
*
ctx
)
{
const
char
*
p
;
int
rc
=
LDAP_DECODING_ERROR
;
...
...
@@ -722,13 +722,17 @@ ldap_bv2dn_x( struct berval *bv, LDAPDN *dn, unsigned flags, void *ctx )
LDAPDN
newDN
=
NULL
;
LDAPRDN
newRDN
=
NULL
,
tmpDN_
[
TMP_RDN_SLOTS
],
*
tmpDN
=
tmpDN_
;
int
num_slots
=
TMP_RDN_SLOTS
;
char
*
str
=
bv
->
bv_val
;
char
*
end
=
str
+
bv
->
bv_len
;
char
*
str
,
*
end
;
struct
berval
bvtmp
,
*
bv
=
&
bvtmp
;
assert
(
bv
);
assert
(
bv
->
bv_val
);
assert
(
bv
in
);
assert
(
bv
in
->
bv_val
);
assert
(
dn
);
*
bv
=
*
bvin
;
str
=
bv
->
bv_val
;
end
=
str
+
bv
->
bv_len
;
#ifdef NEW_LOGGING
LDAP_LOG
(
OPERATION
,
ARGS
,
"ldap_bv2dn(%s,%u)
\n
%s"
,
str
,
flags
,
""
);
#else
...
...
@@ -740,10 +744,23 @@ ldap_bv2dn_x( struct berval *bv, LDAPDN *dn, unsigned flags, void *ctx )
switch
(
LDAP_DN_FORMAT
(
flags
)
)
{
case
LDAP_DN_FORMAT_LDAP
:
case
LDAP_DN_FORMAT_LDAPV3
:
case
LDAP_DN_FORMAT_LDAPV2
:
case
LDAP_DN_FORMAT_DCE
:
break
;
/* allow DN enclosed in brackets */
case
LDAP_DN_FORMAT_LDAPV2
:
if
(
str
[
0
]
==
'<'
)
{
if
(
bv
->
bv_len
<
2
||
end
[
-
1
]
!=
'>'
)
{
rc
=
LDAP_DECODING_ERROR
;
goto
parsing_error
;
}
bv
->
bv_val
++
;
bv
->
bv_len
-=
2
;
str
++
;
end
--
;
}
break
;
/* unsupported in str2dn */
case
LDAP_DN_FORMAT_UFN
:
case
LDAP_DN_FORMAT_AD_CANONICAL
:
...
...
Write
Preview
Supports
Markdown
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