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
orbea -
OpenLDAP
Commits
2ee43073
Commit
2ee43073
authored
Feb 09, 2009
by
Howard Chu
Browse files
ITS#5927 MicrosoftAD compatibility hack (YUCK) - treat '=' as '-'
if defined in an attributeoption
parent
4bc8cb63
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/ad.c
View file @
2ee43073
...
...
@@ -64,6 +64,8 @@ static Attr_option lang_option = { BER_BVC("lang-"), 1 };
static
Attr_option
*
options
=
&
lang_option
;
static
int
option_count
=
1
;
static
int
msad_range_hack
=
0
;
static
Attr_option
*
ad_find_option_definition
(
const
char
*
opt
,
int
optlen
);
static
int
ad_keystring
(
...
...
@@ -76,7 +78,9 @@ static int ad_keystring(
}
for
(
i
=
1
;
i
<
bv
->
bv_len
;
i
++
)
{
if
(
!
AD_CHAR
(
bv
->
bv_val
[
i
]
)
)
{
if
(
!
AD_CHAR
(
bv
->
bv_val
[
i
]
))
{
if
(
msad_range_hack
&&
bv
->
bv_val
[
i
]
==
'='
)
continue
;
return
1
;
}
}
...
...
@@ -234,7 +238,8 @@ int slap_bv2ad(
}
else
if
(
ad_find_option_definition
(
opt
,
optlen
)
)
{
int
i
;
if
(
opt
[
optlen
-
1
]
==
'-'
)
{
if
(
opt
[
optlen
-
1
]
==
'-'
||
(
opt
[
optlen
-
1
]
==
'='
&&
msad_range_hack
))
{
desc
.
ad_flags
|=
SLAP_DESC_TAG_RANGE
;
}
...
...
@@ -1178,6 +1183,11 @@ ad_define_option( const char *name, const char *fname, int lineno )
optlen
=
0
;
do
{
if
(
!
DESC_CHAR
(
name
[
optlen
]
)
)
{
/* allow trailing '=', same as '-' */
if
(
name
[
optlen
]
==
'='
&&
!
name
[
optlen
+
1
]
)
{
msad_range_hack
=
1
;
continue
;
}
Debug
(
LDAP_DEBUG_ANY
,
"%s: line %d: illegal option name
\"
%s
\"\n
"
,
fname
,
lineno
,
name
);
...
...
@@ -1204,7 +1214,8 @@ ad_define_option( const char *name, const char *fname, int lineno )
options
[
i
].
name
.
bv_val
=
ch_strdup
(
name
);
options
[
i
].
name
.
bv_len
=
optlen
;
options
[
i
].
prefix
=
(
name
[
optlen
-
1
]
==
'-'
);
options
[
i
].
prefix
=
(
name
[
optlen
-
1
]
==
'-'
)
||
(
name
[
optlen
-
1
]
==
'='
);
if
(
i
!=
option_count
&&
options
[
i
].
prefix
&&
...
...
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