mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-29 11:09:34 -05:00
ITS#5927 MicrosoftAD compatibility hack (YUCK) - treat '=' as '-'
if defined in an attributeoption
This commit is contained in:
parent
4bc8cb6336
commit
2ee43073e9
1 changed files with 14 additions and 3 deletions
|
|
@ -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 &&
|
||||
|
|
|
|||
Loading…
Reference in a new issue