ipa-kdb: Be flexible

Although the proper values for booleans from LDAP should be only uppercase,
389ds does allow wrong cased values without complaining. And we still have some
places where the wrong case is used.
Avoid getting frustrating errors when reading these values out.
This commit is contained in:
Simo Sorce 2011-07-20 15:44:11 -04:00
parent 8cb2aee626
commit d8de2d1b7b

View File

@ -372,10 +372,10 @@ int ipadb_ldap_attr_to_bool(LDAP *lcontext, LDAPMessage *le,
vals = ldap_get_values_len(lcontext, le, attrname); vals = ldap_get_values_len(lcontext, le, attrname);
if (vals) { if (vals) {
if (strcmp("TRUE", vals[0]->bv_val) == 0) { if (strcasecmp("TRUE", vals[0]->bv_val) == 0) {
*result = true; *result = true;
ret = 0; ret = 0;
} else if (strcmp("FALSE", vals[0]->bv_val) == 0) { } else if (strcasecmp("FALSE", vals[0]->bv_val) == 0) {
*result = false; *result = false;
ret = 0; ret = 0;
} else { } else {