無法解析 LDIF 檔案的問題(無效格式(第 5 行)項目:「cn=schema」)

無法解析 LDIF 檔案的問題(無效格式(第 5 行)項目:「cn=schema」)

嘗試使用以下命令向架構新增屬性:

ldapmodify -f ./add-id-attribute.ldif -h localhost -p 50389 -D "cn=Directory Manager" -w mySecretPassword

還有這個 LDIF 文件

dn: cn=schema
changetype: modify
add: attributetypes
attributetypes: ( 1.3.6.1.4.1.32474 NAME 'myAttribute'
    USAGE userApplications )
    DESC 'The attribute'

但它給了我以下回應:ldapmodify: invalid format (line 5) entry: "cn=schema"

我已經將行結尾更改為 UNIX,但這沒有幫助。我正在使用一個 docker 映像OpenAM 6.5.2作為OpenDJ目錄伺服器。

答案1

您的 LDiF 格式不正確。

DESC行位於 USAGE 行的右括號之後),因此無法解析。

您需要移動,)以便 attributeTypes 定義完全包含在( )

dn: cn=schema
changetype: modify
add: attributetypes
attributetypes: ( 1.3.6.1.4.1.32474 NAME 'myAttribute'
    USAGE userApplications 
    DESC 'The attribute' )

相關內容