Bug 11729 - Attribute names appear to behave with case sensitivity on custom objectClasses
Summary: Attribute names appear to behave with case sensitivity on custom objectClasses
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: 4.1.17
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-09 21:20 UTC by Patrice Levesque
Modified: 2016-03-10 11:51 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrice Levesque 2016-02-09 21:20:58 UTC
It appears there is case-sensitivity when it comes to attribute names.  This
recipe reproduces the problem, on Debian Jessie's Samba 4.1.17.

All the following LDIF are applied using:
	ldbmodify -v -H /var/lib/samba/private/sam.ldb

1) Create a new attribute, using an uppercase first letter:

dn: CN=UpperCaseAttribute,CN=Schema,CN=Configuration,dc=your,dc=domain
changeType: add
objectClass: top
objectClass: attributeSchema
attributeID: 1.3.6.1.4.1.99999.0
cn: UpperCaseAttribute
name: UpperCaseAttribute
lDAPDisplayName: UpperCaseAttribute
attributeSyntax: 2.5.5.12
oMSyntax: 64
isSingleValued: TRUE


2) Hook that attribute into a new classSchema, referring to this new attribute
using a lowercase first letter; no error:

dn: CN=SomeRandomClass,CN=Schema,CN=Configuration,dc=your,dc=domain
changeType: add
objectClass: top
objectClass: classSchema
governsID: 1.3.6.1.4.1.99999.1
cn: SomeRandomClass
name: SomeRandomClass
lDAPDisplayName: SomeRandomClass
objectClassCategory: 3
mustContain: cn
mayContain: upperCaseAttribute
defaultObjectCategory: CN=SomeRandomClass,CN=Schema,CN=Configuration,dc=your,dc=domain


3) Create a container for a new entry:

dn: ou=TestContainer,dc=your,dc=domain
changetype: add
objectClass: top
objectClass: organizationalUnit
ou: TestContainer


4) Try to add a new object of type SomeRandomClass, adding person as
objectClass to get a structural:

dn: cn=TestRandomObject,ou=TestContainer,dc=your,dc=domain
changetype: add
objectClass: top
objectClass: person
objectClass: SomeRandomClass2
cn: TestRandomObject
upperCaseAttribute: MyValue

This last step *fails*, with:

ERR: (Object class violation) "objectclass_attrs: attribute 'UpperCaseAttribute' on entry 'CN=TestRandomObject,OU=TestContainer,DC=example,DC=com' does not exist in the specified objectclasses!" on DN cn=TestRandomObject,ou=TestContainer,dc=example,dc=com

Note that the error message has the right spelling!

Retrying the same recipe, using 'upperCaseAttribute' throughout, does not cause any error.

As far as I know, in the above, there should be no case-sensitivity.

Discovered while trying to import a mixed-case schema modifications LDIF that
worked well under the official AD implementation.  Another related issue I hit
is bug #10094 - I needed to split the schema modification recipe in multiple
LDIF files.