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

Matthieu Patou mat at samba.org
Wed Apr 11 10:57:32 MDT 2012


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





-- 
Matthieu Patou
Samba Team
http://samba.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ol2schema.patch
Type: text/x-patch
Size: 1193 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20120411/b752c5de/attachment.bin>


More information about the samba-technical mailing list