What is the origin of dsdb_syntax dsdb_syntaxes[] in source4/dsdb/schema/schema_syntax.c?

Gémes Géza geza at kzsdabas.hu
Wed Apr 11 12:58:49 MDT 2012


2012-04-11 20:03 keltezéssel, Gémes Géza írta:
> 2012-04-11 18:57 keltezéssel, Matthieu Patou írta:
>> On 04/10/2012 10:46 AM, Gémes Géza wrote:
>>> 2012-04-10 19:12 keltezéssel, Matthieu Patou írta:
>>>> On 04/10/2012 03:52 AM, Gémes Géza wrote:
>>>>> 2012-04-10 09:43 keltezéssel, Matthieu Patou írta:
>>>>>> On 04/09/2012 11:55 PM, Gémes Géza wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> In an attempt to create AD compatible schema ldif file (to be
>>>>>>> loaded in
>>>>>>> Samba4) for the ISC DHCPD (LDAP support is included in the ISC DHCPD
>>>>>>> from 4.2, but extended to include support for IPv6 by:
>>>>>>> http://www.mentby.com/jiri-popelka/isc-dhcp-42-with-ldap-and-ipv6.html)
>>>>>>>
>>>>>>>
>>>>>>> tried  to convert the attached schema file to AD schema ldif.
>>>>>>> oLschema2ldif failed after converting a few attributes. Looking
>>>>>>> at its
>>>>>>> source code I've found, that it is using a mapping between ldap_oid,
>>>>>>> attributeSyntax_oid and oMSyntax in dsdb_syntax dsdb_syntaxes[] from
>>>>>>> source4/dsdb/schema/schema_syntax.c. In order to be able to
>>>>>>> convert an
>>>>>>> arbitrary (in my case dhcpd) schema file I would need a generic
>>>>>>> mapping
>>>>>>> rule set between ldap_oids and attributes needed by AD
>>>>>>> (attributeSyntax_oid and oMSyntax)
>>>>>> What is dsdb_syntaxes is supposed to be the rule for MS AD.
>>>>>>
>>>>>>   From your file I found the following syntax
>>>>>>
>>>>>> 1.3.6.1.4.1.1466.115.121.1.12
>>>>>> 1.3.6.1.4.1.1466.115.121.1.24
>>>>>> 1.3.6.1.4.1.1466.115.121.1.26
>>>>>> 1.3.6.1.4.1.1466.115.121.1.27
>>>>>> 1.3.6.1.4.1.1466.115.121.1.40
>>>>>> 1.3.6.1.4.1.1466.115.121.1.7
>>>>>>
>>>>>> Which one is missing in the table ?
>>>>>>
>>>>>>
>>>>>> Matthieu.
>>>>>>
>>>>> oLschema2ldif fails at converting attribute dhcpOptionsDN which is the
>>>>> first with syntax 1.3.6.1.4.1.1466.115.121.1.12
>>>> lib/ldb/include/ldb.h
>>>> 432:#define LDB_SYNTAX_DN
>>>> "1.3.6.1.4.1.1466.115.121.1.12"
>>>>
>>>> I guess oLschema2ldif needs to be fixed !
>>> or source4/dsdb/schema/schema_syntax.c?
>> Why ?
>>
>>
>> Except from  schema_syntax.c
>>
>>                .name                   = "Object(DS-DN)",
>>                 .ldap_oid               = LDB_SYNTAX_DN,
>>                 .oMSyntax               = 127,
>>                 .oMObjectClass          =
>> OMOBJECTCLASS("\x2b\x0c\x02\x87\x73\x1c\x00\x85\x4a"),
>>                 .attributeSyntax_oid    = "2.5.5.1",
>>                 .drsuapi_to_ldb         = dsdb_syntax_DN_drsuapi_to_ldb,
>>                 .ldb_to_drsuapi         = dsdb_syntax_DN_ldb_to_drsuapi,
>>                 .validate_ldb           = dsdb_syntax_DN_validate_ldb,
>>                 .equality               = "distinguishedNameMatch",
>>                 .comment                = "Object(DS-DN) == a DN",
>>
>> So this syntax exists, as I said oLschema2ldif needs to be fixed
>> because oMObjectClass is not added and if you want to screw your
>> schema not adding this attribute is the way to go.
>>
>> As a proof of this you should try my attached patch, it turns out that
>> oLschema2ldif is sensitive and expect open and closing bracket to have
>> a space before them, it won't fix everything as you'll run into
>> trouble due to lack of oMObjectClass attribute on object that are with
>> the DN syntax, but if should work better.
>>
>> Matthieu
>>
>>
>>
>>
>>
> Sorry, my fault didn't read it throughly enough.
> Thanks for the patch. I've just applied it. Now I' m compiling. Will
> come back with the results.
>
> Cheers
>
> Geza
Hi,

So far (after fixing a few closing brackets in the original schema file)
everything seems fine so far, wit only some warnings:
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'dhcpSharedNetwork')
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'dhcpSharedNetwork')
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'dhcpService'
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'dhcpSubnet'
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'dhcpSubnet'
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'dhcpSharedNetwork'
Unknown Definition: 'dhcpPool'
Unknown Definition: 'dhcpHost'
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'dhcpService'
Unknown Definition: 'dhcpPool')
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'dhcpPool'
Unknown Definition: 'dhcpSharedNetwork'
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'organizationalunit'
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'dhcpSharedNetwork'
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'dhcpSharedNetwork'
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'dhcpSharedNetwork'
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'organizationalunit'
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'dhcpSharedNetwork')
Unknown Definition: X-NDS_CONTAINMENT
Unknown Definition: 'dhcpSharedNetwork')
Converted 76 records with 0 failures

Will try to load the new schema to samba4 shortly.

Cheers

Geza


More information about the samba-technical mailing list