Closed Bug 77372 Opened 25 years ago Closed 22 years ago

addvalue assumes attributes are case sensitive

Categories

(Directory Graveyard :: PerLDAP, defect)

Sun
Solaris
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mozbugs, Assigned: leif)

Details

when using addValue, if there is an existing value "Jazz" (note uppercase J), and I do addValue("whatever", "jazz") (note lowercase J), the addValue returns TRUE, which supposidly means that the newly added value is unique and NOT a duplicate. However, upon doing the update to the server, the server complains that this is a duplicate value if the attribute is defined as cis. Should addValue be ignoring case in this case? (It doesn't appear to be) Obviously the server ignores it.
Reversing database corruption. Pay no attention to the man behind the curtain.
QA Contact: mystery.user
same problem exists when using setValuess
Status: NEW → ASSIGNED
Unfortunately PerLDAP doesn't (currently) have any knowledge of the schema, so it has no way of knowing that your attribute is CIS. So, the decision was made to assume all strings to be case sensitive. That much said, I've added a fifth, optional, boolean argument to addValue(), which indicates that you want to treat values as case insensitive. Unforfortunately, this would have made more sense to have as the fourth argument, but I can't break backward compatibility. So, to use it, you have to explicitly pass the normalizatoin argument, e.g. $e->addValue("what", "this", 0, 0, 1); ugly, but best we can do now. This is on the dev-branch and for v1.5 release. With this fix, if you provide the "nocase" option, the Entry module will properly detect the existance of the value, and not generate the modification (and hence, avoid the server error, "LDAP error: Type or value exists").
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.