--On Thursday, February 10, 2005 4:57 AM +0100 pascal@linuxorable.net wrote:
Quanah Gibson-Mount <quanah@stanford.edu> a écrit :
--On Thursday, February 10, 2005 4:08 AM +0100 pascal@linuxorable.net
wrote:
ldapsearch -h localhost -x -b "dc=linuxorable,dc=net"
'(postalAddress=*<something>*)'
and
ldapsearch -h localhost -x -b "dc=linuxorable,dc=net"
'(homePostalAddress=*<something>*)'
and
ldapsearch -h localhost -x -b "dc=linuxorable,dc=net"
'(registeredAddress=*<something>*)'
don't work !
(all other attributes work perfectly)
The only index I can define for these attributes is "pres" (other index
are not allowed => error message when restarting slapd)
The non-working ones are substring searches. You need to add a substring
index for them.
I would like but I can't !
I tried this: (slapd.conf:)
index postalAddress sub
index homePostalAddress sub
index registeredAddress sub
but I get:
# /etc/init.d/slapd restart
Stopping OpenLDAP: slapd.
Starting OpenLDAP: slapd - failed:
/etc/ldap/slapd.conf: line 379: substr index of attribute "postalAddress"
disallowed
euphorie:/usr/local/www/horde/config# /etc/init.d/slapd restart
Stopping OpenLDAP: slapd.
Starting OpenLDAP: slapd - failed:
/etc/ldap/slapd.conf: line 380: substr index of attribute
"homePostalAddress"
disallowed
euphorie:/usr/local/www/horde/config# /etc/init.d/slapd restart
Stopping OpenLDAP: slapd.
Starting OpenLDAP: slapd - failed:
/etc/ldap/slapd.conf: line 381: substr index of attribute
"registeredAddress"
disallowed
I don't know what to do.
Could you explain me how you know that these attributes are substring
searches
Well, according to the OL 2.2 schema (I don't know about 2.1) you can do a
substring index on postalAddress:
attributetype ( 2.5.4.16 NAME 'postalAddress'
DESC 'RFC2256: postal address'
EQUALITY caseIgnoreListMatch
SUBSTR caseIgnoreListSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )
registeredAddress inherits from postalAddress, so that should also work (in
OL 2.2).
attributetype ( 0.9.2342.19200300.100.1.39 NAME 'homePostalAddress'
DESC 'RFC1274: home postal address'
EQUALITY caseIgnoreListMatch
SUBSTR caseIgnoreListSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )
same thing for homePostalAddress -- It allows substring.
You may need to upgrade to OL 2.2.23 to do substring searches. I suggest
looking at core.schema and cosine.schema for the attribute definitions to
find out if OL 2.1 allows substring indexing.
--Quanah
--
Quanah Gibson-Mount
Principal Software Developer
ITSS/Shared Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
"These censorship operations against schools and libraries are stronger
than ever in the present religio-political climate. They often focus on
fantasy and sf books, which foster that deadly enemy to bigotry and blind
faith, the imagination." -- Ursula K. Le Guin