歡迎您光臨本站 註冊首頁

請教schema文件的問題,多謝!!

←手機掃碼閱讀     火星人 @ 2014-03-05 , reply:0

請教schema文件的問題,多謝!!

schema文件內容:
objectclass        ( 2.5.6.104
        NAME 'nariPerson'
        DESC 'RFC2799:Used to auth person who want to access'
        SUP person
        STRUCTURAL
        MUST( Framed-IP-Netmask $ Framed-IP-Address $ NAS_IP_RULE $
                NAS_FILE_RULE $ Group-ID $ NAS_DIRECTORY )
        MAY (  title $ homeAddress $ uid $ telexNumber $
                street $ postOfficeBox $ postalCode $
                postalAddress $ physicalDeliveryOfficeName $
                sex $ birthday $ certificate $
                userCertificate $ userPKCert )
        )
============================================
調試結果:
./slapd -4d 256
@(#) $OpenLDAP: slapd 2.3.27 (Feb  1 2007 21:23:09) $
        root@NARI:/root/chenjianyesky/ldap/openldap-2.3.27/servers/slapd
/usr/local/openldap/etc/openldap/schema/njuPerson.schema: line 13: Unexpected token before         MAY (  title $ registeredAddress $                userAlias $ id $ sid $ c $ nation $                telexNumber $ teletexTerminalIdentifier $                telephoneNumber $ street $ postOfficeBox $ postalCode $  postalAddress $ physicalDeliveryOfficeName $ ou $ st $ l $                sex $ birthday $ certificate $ major $institute $                department $ entranceTime $ studyDirection $     homeAddress $ teacheAge $             roleInfo $ serviceInfo $ sessionID $ sessionLastVisitTime $                userCertificate $ userPKCS12Cert $ userPKCS12Password                ) )
ObjectClassDescription = "(" whsp
  numericoid whsp                 ; ObjectClass identifier
  [ "NAME" qdescrs ]
  [ "DESC" qdstring ]
  [ "OBSOLETE" whsp ]
  [ "SUP" oids ]                ; Superior ObjectClasses
  [ ( "ABSTRACT" / "STRUCTURAL" / "AUXILIARY" ) whsp ]
                                  ; default structural
  [ "MUST" oids ]               ; AttributeTypes
  [ "MAY" oids ]                ; AttributeTypes
  whsp ")"
slapd stopped.
connections_destroy: nothing to destroy.

搞了好半天沒搞定,請大俠指點原因,指教如何修改schema文件!!
《解決方案》

我修改了其中的MUST和MAY,但是...

我修改了其中的MUST和MAY,使之只有一個項,然後前面進行了attributetype,隨便加了一些數字,但是提示Syntax not found,我沒有查到怎樣才能正確的填寫syntax(或許是這個原因造成的),請高手指教!
《解決方案》

As you don't have enough knowledge of writing the schema file appropriately, you should minimize your objectclass rather than including all your customized attributetype at first step and try to keep it as similar as the original one.
《解決方案》

Thank you! I have tried to minimize it, include only one item in MUST term, but it's the same error! Is there an introduce or example for schema? Thanks!!
《解決方案》

有沒有高手來幫忙解決一下呀?

有沒有高手來幫忙解決一下呀?
《解決方案》

lz真有意思,你定義了哪么多屬性 Framed-IP-Netmask $ Framed-IP-Address ……

怎麼沒見你都有定義呀,就只定義了一個objectclass,每一個屬性都要定義的,

至於oid,理論上與你其它定義的不衝突就行了。

如果用1打頭的好象是保留編號,就象127.0.0.1一樣,

想正規一點還是去申請一個,
《解決方案》

謝謝,我試一下

原帖由 wangbaohua 於 2007-2-8 10:03 發表
lz真有意思,你定義了哪么多屬性 Framed-IP-Netmask $ Framed-IP-Address ……

怎麼沒見你都有定義呀,就只定義了一個objectclass,每一個屬性都要定義的,

至於oid,理論上與你其它定義的不衝突就行了。
...

我試驗一下,同時去掉一些屬性,只保留一兩個,然後屬性都定義,
是不是syntax的數字只要第一個數字不是1就行了?
《解決方案》

請幫我看一下,現在修改了還是不行呀?

schema文件內容:
attributetype (2.16.840.1.223793.31.1.1 NAME 'team'
DESC 'just a test'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-value )

objectclasses: (2.16.840.1.223793.31.2.1
        NAME 'nariPerson'
        SUP 'inetOrgPerson'
        MUST (objectclass $ sn $ cn)
        MAY (team )
)

錯誤結果:
# ./slapd -d 256
@(#) $OpenLDAP: slapd 2.3.27 (Feb  1 2007 21:23:09) $
        root@NARI:/root/chenjianyesky/ldap/openldap-2.3.27/servers/slapd
/usr/local/openldap/etc/openldap/schema/test3.schema: line 1: Missing closing parenthesis before ema/test3.schema
AttributeTypeDescription = "(" whsp
  numericoid whsp      ; AttributeType identifier
  [ "NAME" qdescrs ]             ; name used in AttributeType
  [ "DESC" qdstring ]            ; description
  [ "OBSOLETE" whsp ]
  [ "SUP" woid ]                 ; derived from this other
                                   ; AttributeType
  [ "EQUALITY" woid ]            ; Matching Rule name
  [ "ORDERING" woid ]            ; Matching Rule name
  [ "SUBSTR" woid ]              ; Matching Rule name
  [ "SYNTAX" whsp noidlen whsp ] ; see section 4.3
  [ "SINGLE-VALUE" whsp ]        ; default multi-valued
  [ "COLLECTIVE" whsp ]          ; default not collective
  [ "NO-USER-MODIFICATION" whsp ]; default user modifiable
  [ "USAGE" whsp AttributeUsage ]; default userApplications
                                   ; userApplications
                                   ; directoryOperation
                                   ; distributedOperation
                                   ; dSAOperation
  whsp ")"
slapd stopped.
connections_destroy: nothing to destroy.
《解決方案》

晃眼看了一下,至少有一個地方有問題,



objectclasses: (………………)
對比
objectclasses  (………………)

oid只要不衝突就行。

[火星人 ] 請教schema文件的問題,多謝!!已經有532次圍觀

http://coctec.com/docs/service/show-post-41181.html