Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

OpenLDAP の slapd.conf で index の設定を変更した場合

http://d.hatena.ne.jp/satob/20040705#p6 これの解決編。

  • slapd.conf で index に指定した属性(例として index uid eq)について、ディレクトリエントリとしては存在する(objectClass=* で検索をかけると出てくる)のに……
    • 値を明示しない (uid=*) で検索をかけるときは引っかかる
    • 値を明示(uid=1000 とか)して検索をかけるとが引っかからない

これは、index の設定と実際のデータの不整合が原因。slapd.conf には index にすると書いてあるのに実際には index が存在しないとか。
典型的なエラーメッセージは次のようになると思う。

yusuke@hoge:~$ su ldaptest
不明な ID です: ldaptest
yusuke@hoge:~$  

次のコマンドを実行すればよい。

# slapindex -v -b dc=example,dc=com -f /etc/ldap/slapd.conf