[Samba] Naming violation: objectClass: myObjectClass not a valid child class for <>

Rowland penny rpenny at samba.org
Sun Jul 26 11:06:03 UTC 2020

On 26/07/2020 10:58, RhineDevil wrote:
> You said you didn't want to help me about this but if you'd do at least I'd learn something useful for custom schemas, since this type of error isn't referenced anywhere

No, I said I wouldn't help you shoot yourself in the foot, this isn't 
shooting anything ;-)

Create two ldif files:


dn: CN=nisMailAlias,CN=Schema,CN=Configuration,dc=local
objectClass: top
objectClass: classSchema
schemaIdGuid:: gMnYtZqCPTLAMXe3RZus8A==
cn: nisMailAlias
name: nisMailAlias
lDAPDisplayName: nisMailAlias
# possSuperiors: top
subClassOf: top
mustContain: cn
mayContain: rfc822MailMember
showInAdvancedViewOnly: FALSE
adminDisplayName: nisMailAlias
adminDescription: NIS mail alias
objectClassCategory: 1
systemOnly: FALSE
defaultObjectCategory: CN=nisMailAlias,CN=Schema,CN=Configuration,dc=local


dn: CN=rfc822MailMember,CN=Schema,CN=Configuration,dc=local
objectClass: top
objectClass: attributeSchema
schemaIdGuid:: aB7do9Dx3LkCSVgvixllpg==
cn: rfc822MailMember
name: rfc822MailMember
lDAPDisplayName: rfc822MailMember
adminDisplayName: rfc822MailMember
adminDescription: rfc822 mail address of group member(s)
isSingleValued: FALSE
oMSyntax: 22

Now add the schema update like this:

service samba-ad-dc stop

ldbmodify -H /var/lib/samba/private/sam.ldb /tmp/attr.ldif 
--option="dsdb:schema update allowed"=true

ldbmodify -H /var/lib/samba/private/sam.ldb /tmp/class.ldif 
--option="dsdb:schema update allowed"=true

service samba-ad-dc start

Finally, Create another ldif:


dn: ou=myOrganizationUnit,dc=local
ou: myOrganizationUnit
objectClass: top
objectClass: organizationalUnit

dn: cn=abuse,ou=myOrganizationUnit,dc=local
cn: abuse
objectClass: nisMailAlias
objectClass: top
rfc822MailMember: root

and add it with:

ldbadd -H /var/lib/samba/private/sam.ldb /tmp/mod.ldif


More information about the samba mailing list