|
|
ru.unix- RU.UNIX ---------------------------------------------------------------------- From : Alexander Lunyov 2:5059/20.5 25 Feb 2004 22:19:16 To : Victor Sudakov Subject : openldap, TheBat, русский язык -------------------------------------------------------------------------------- * hi ** Victor Sudakov => Alexander Lunyov >>> В 1.x можно было в конце концов вообще поставить "schemacheck off" и >>> писать в entries что в голову взбредёт. >> В 2.1.х можно поставить то же самое. > В man slapd.conf не нашел. Ткни пальцем, пожалуйста. В мане нету, но опция работает. >>> Вот ты бы "сделал доп. objectclass" - а OID откуда бы взял? >> В IANA. Hичего страшного в этом нет, я получил OID на своё предприятие >> за полтора дня. > Тут мне подсказывают, что есть приватные. Слушай, ну вот скажи, тебе трудно на сайт IANA залезть, да? :) > Hепременно нужно dn с "o=COMPANY, c=RU", потому что у всех пользователей > стоит именно такой search base. Это не критично, я-то пробовал на своей базе. Принцип тот же. > Так вот, ldapadd ругается > adding new entry "uid=sudakov, o=SIBPTUS, c=RU" > ldapadd: update failed: uid=sudakov, o=SIBPTUS, c=RU > ldap_add: Object class violation (65) > additional info: attribute 'c' not allowed > Изучение *.schema показало, что классу inetOrgPerson атрибут "c" вроде > как действительно не положен (его нет в MAY для данного класса и > родительских классов). > Тупо добавить в запись "objectclass: country" тоже не помогло: > ldap_add: Object class violation (65) > additional info: invalid structural object class chain > (inetOrgPerson/country) А вот от этой ошибки тебя спасет schemacheck off или написание своей собственной схемы. Кстати да, если ты заметил, с параметром schemacheck off мне позволилось добавить entry, совершенно не коррелирующую с объявленными в ней классами (атрибут 'c' не входит ни в top, ни в inetOrgPerson). Однако вот мои эксперименты с тестовым LDIF'ом: ============================================== dn: cn=newinetorgperson, dc=domain,dc=ru objectclass: country objectclass: inetOrgPerson sn: newinetorgperson cn: newinetorgperson o: org c: RU mail: some@mail.mail uid: some ============================================== ======================================================================= >здесь в slapd.conf переменная 'schemacheck off' закомментирована helios@root [20:58:00] /usr/local/etc/openldap # ldapadd -x -D cn=root,dc=domain,dc=ru -W -f test.ldif Enter LDAP Password: adding new entry "cn=newinetorgperson, dc=domain,dc=ru" ldapadd: update failed: cn=newinetorgperson, dc=domain,dc=ru ldap_add: Object class violation (65) additional info: invalid structural object class chain(country/inetOrgP erson) >а здесь я её раскомментировал и передернул slapd helios@root [20:58:53] /usr/local/etc/openldap # ldapadd -x -D cn=root,dc=domain,dc=ru -W -f test.ldif Enter LDAP Password: adding new entry "cn=newinetorgperson, dc=domain,dc=ru" helios@root [20:59:26] /usr/local/etc/openldap # ======================================================================= Ошибка возникает из-за того, что класс country структурно (structural, смотри определения классов в файлах схем) подтягивает класс top, и тот же класс top также (structural) подтягивается в inetOrgPerson (через organizationalPerson, если точнее). То есть получается top / \ country organizationalPerson \ inetOrgPerson А одна конкретная entry может содержать классы (и атрибуты классов) только одной цепочки структурно зависимых классов (если я всё правильно понял). Именно поэтому я рисовал свою схему - inetOrgPerson не ужился с radiusProfile. В общем, это не очень сложно, просто надо читать и писать аккуратно. Кстати, про аккуратно читать. Виктор, ошибка "invalid structural object class chain" подробно описана в FAQ'е проекта OpenLDAP. Hа всякий случай, опять же, если инет есть только у меня (кстати, это первая же ссылка в гугле на тему 'openldap invalid structural object class chain'): ============================================================================== >Problems with structural objectclasses A common error that is encountered when upgrading from earlier versions of OpenLDAP is 'invalid structural object class chain'. This occurs because 2.1.x versions enforce more of the LDAP structure rules than 2.0.x did, and many directories contain incorrect data because of the lax checking of the earlier versions. This particular error refers to the rule about STRUCTURAL objectclasses, which states that an entry may only use one chain of STRUCTURAL classes. Thus, it is OK for an entry to use the classes inetOrgPerson organizationalPerson and person because they inherit one from another to form a single chain. On the other hand, it is not possible to use inetOrgPerson and account in the same entry as account inherits directly from top and is not part of the same chain of classes as inetOrgPerson. >Solving the problem It may be tempting to re-label one of the problematic objectclasses as AUXILIARY. Please don't do that! You would be re-defining things that other people have made assumptions about, which is a good way of storing up trouble for the future. The right solution is to remove one of the offending objectclasses from your entries and (if necessary) replace it with one that does not conflict. You may be able to find another objectclass in the standard set that would do the job - perhaps using posixAccount in place of account. Alternatively, you will need to define an objectclass of your own that allows the attributes that you need. >An example of a new objectclass Suppose we need to include uid and mail in some entries but their existing objectclasses do not permit this. One solution would be to define a class like this: objectclass ( 1.2.826.0.1.9999998854.0.1.0.1 NAME 'widgetCorpAccount' DESC 'Account in the Widget Corporation' SUP top AUXILIARY MAY ( uid $ mail ) ) Note that this is an AUXILIARY class so it will not conflict with any others. Note also that the OID (1.2.826.0.1.9999998854.0.1.0.1 in this case) must be globally unique. You should get an officially allocated OID prefix for your organisation and define your own OIDs under it. Now, by adding objectclass: widgetCorpAccount to your entries you will be able to add mail and uid attributes. ============================================================================== * bye --- * Origin: no sex until marriage! (c) Front242 (2:5059/20.5) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.unix/2765403ce729.html, оценка из 5, голосов 10
|