Hello
I'm using dnsDomain2 schema with openldap 2.2.27 for dns server (pdns). When I look into the logfiles i saw that some questions are not answered by slapd.
When I ask: ldapsearch -x -LLL "dc=hostname" i get the follwing answer: dn: dc=hostnanme,dc=example.local,ou=DNS,ou=Services,dc=example,dc=local objectClass: top objectClass: dNSDomain2 objectClass: domainRelatedObject dc: hostname aRecord: 192.168.1.1 pTRRecord: hostname.example.local associatedDomain: hostname.example.local ok, but ldapsearch -x -LLL "aRecord=192.168.1.1" or ldapsearch -x -LLL "aRecord=192*" returns nothing and ldapsearch -x -LLL "aRecord=*" returns all entries.
The entry 'aRecord' is of type caseIgnoreIA5Match. What's wrong there? Any ideas?
Quoting "Jürgen Magin" gaston@octo-soft.de:
The entry 'aRecord' is of type caseIgnoreIA5Match. What's wrong there? Any ideas?
From what I know, the key word here is 'Match'...
As i read it, it doesn't matter if you use upper or lower case, but the string must match...
--On Monday, December 11, 2006 9:06 AM +0100 Jürgen Magin gaston@octo-soft.de wrote:
Hello
I'm using dnsDomain2 schema with openldap 2.2.27 for dns server (pdns). When I look into the logfiles i saw that some questions are not answered by slapd.
When I ask: ldapsearch -x -LLL "dc=hostname" i get the follwing answer: dn: dc=hostnanme,dc=example.local,ou=DNS,ou=Services,dc=example,dc=local objectClass: top objectClass: dNSDomain2 objectClass: domainRelatedObject dc: hostname aRecord: 192.168.1.1 pTRRecord: hostname.example.local associatedDomain: hostname.example.local ok, but ldapsearch -x -LLL "aRecord=192.168.1.1" or ldapsearch -x -LLL "aRecord=192*" returns nothing and ldapsearch -x -LLL "aRecord=*" returns all entries.
The entry 'aRecord' is of type caseIgnoreIA5Match. What's wrong there? Any ideas?
Yes. You apparently didn't read the schema definition:
# 9.3.22. DNS ARecord # # The A Record attribute type specifies a type A (Address) DNS resource # record [6] [7]. # # aRecord ATTRIBUTE # WITH ATTRIBUTE-SYNTAX # DNSRecordSyntax # ::= {pilotAttributeType 26} # ## incorrect syntax? attributetype ( 0.9.2342.19200300.100.1.26 NAME 'aRecord' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
As you can see, there is *no* SUBSTR defined, so there is no defined rule on how to handle substring searches.
--Quanah
-- Quanah Gibson-Mount Principal Software Developer ITS/Shared Application Services Stanford University GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
Thanks for your quick answer. You are right there is no substring match defined. But i got no answer too, when i search for the whole string. That is what i don't understand.
Quanah Gibson-Mount schrieb:
--On Monday, December 11, 2006 9:06 AM +0100 Jürgen Magin gaston@octo-soft.de wrote:
dn:
dc=hostnanme,dc=example.local,ou=DNS,ou=Services,dc=example,dc=local objectClass: top objectClass: dNSDomain2 objectClass: domainRelatedObject dc: hostname aRecord: 192.168.1.1 pTRRecord: hostname.example.local associatedDomain: hostname.example.local ok, but ldapsearch -x -LLL "aRecord=192.168.1.1" returns nothing
This is the whole value "192.168.1.1" in database.
As you can see, there is *no* SUBSTR defined, so there is no defined rule on how to handle substring searches.
--Quanah
On Monday 11 December 2006 10:06, Jürgen Magin wrote:
Hello
I'm using dnsDomain2 schema with openldap 2.2.27 for dns server (pdns). When I look into the logfiles i saw that some questions are not answered by slapd.
When I ask: ldapsearch -x -LLL "dc=hostname" i get the follwing answer: dn: dc=hostnanme,dc=example.local,ou=DNS,ou=Services,dc=example,dc=local objectClass: top objectClass: dNSDomain2 objectClass: domainRelatedObject dc: hostname aRecord: 192.168.1.1 pTRRecord: hostname.example.local associatedDomain: hostname.example.local ok, but ldapsearch -x -LLL "aRecord=192.168.1.1" or ldapsearch -x -LLL "aRecord=192*" returns nothing and ldapsearch -x -LLL "aRecord=*" returns all entries.
The entry 'aRecord' is of type caseIgnoreIA5Match. What's wrong there? Any ideas?
Have you made any changes to the index configuration (assuming you use a slapd.conf for configuration)? If so, did you run slapindex (or an export/import)?
Regards, Buchan
Buchan Milne schrieb:
On Monday 11 December 2006 10:06, Jürgen Magin wrote:
Hello
I'm using dnsDomain2 schema with openldap 2.2.27 for dns server (pdns). When I look into the logfiles i saw that some questions are not answered by slapd.
When I ask: ldapsearch -x -LLL "dc=hostname" i get the follwing answer: dn: dc=hostnanme,dc=example.local,ou=DNS,ou=Services,dc=example,dc=local objectClass: top objectClass: dNSDomain2 objectClass: domainRelatedObject dc: hostname aRecord: 192.168.1.1 pTRRecord: hostname.example.local associatedDomain: hostname.example.local ok, but ldapsearch -x -LLL "aRecord=192.168.1.1" or ldapsearch -x -LLL "aRecord=192*" returns nothing and ldapsearch -x -LLL "aRecord=*" returns all entries.
The entry 'aRecord' is of type caseIgnoreIA5Match. What's wrong there? Any ideas?
Have you made any changes to the index configuration (assuming you use a slapd.conf for configuration)? If so, did you run slapindex (or an export/import)?
Yes I changed the index configuration and run slapindex. Here is the index configuration from my slapd.conf:
index objectClass pres,eq index cn approx,pres,sub,eq index sn approx,pres,sub,eq
## required to support pdb_getsampwnam() index uid approx,pres,sub,eq
## required to support pdb_getsambapwrid() index displayName pres,sub,eq
## uncomment these if you are storing posixAccount and ## posixGroup entries in the directory as well index uidNumber eq index gidNumber eq index memberUid eq
## required to support CourierMailAccount index mail approx,pres,sub,eq index mailsource approx,pres,sub,eq
index sambaSID eq index sambaSIDList eq index sambaPrimaryGroupSID eq index sambaDomainName eq index sambaGroupType eq index default sub
index dhcpHWAddress eq index dhcpClassData eq index associatedDomain approx,pres,sub,eq index member pres,eq index aRecord eq
index ipServicePort eq index ipServiceProtocol eq
I noticed that pdns runs in timeouts. So i had a look for the slapd logfile and saw that slapd got the request, but ansered with: SEARCH RESULT tag=101 err=0 nentries=0 text=
Regards, Buchan
Quoting "Jürgen Magin" gaston@octo-soft.de:
index aRecord eq
Shouldn't that be 'sub' (not 'eq') if you want substring matches?
--On Tuesday, December 12, 2006 5:08 PM +0100 Turbo Fredriksson turbo@bayour.com wrote:
Quoting "Jürgen Magin" gaston@octo-soft.de:
index aRecord eq
Shouldn't that be 'sub' (not 'eq') if you want substring matches?
Did you miss the part where I pointed out that substring searches are not allowed on that attribute, because the schema definition doesn't allow them?
--Quanah
-- Quanah Gibson-Mount Principal Software Developer ITS/Shared Application Services Stanford University GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
Quanah Gibson-Mount schrieb:
--On Tuesday, December 12, 2006 5:08 PM +0100 Turbo Fredriksson turbo@bayour.com wrote:
Quoting "Jürgen Magin" gaston@octo-soft.de:
index aRecord eq
Shouldn't that be 'sub' (not 'eq') if you want substring matches?
Did you miss the part where I pointed out that substring searches are not allowed on that attribute, because the schema definition doesn't allow them?
--Quanah
Sorry guys the substring match is not the point of interest, because the whole string doesn't match too. Have a look to my last mail. :-) Thanks for your responds.
Quoting Quanah Gibson-Mount quanah@stanford.edu:
--On Tuesday, December 12, 2006 5:08 PM +0100 Turbo Fredriksson turbo@bayour.com wrote:
Quoting "Jürgen Magin" gaston@octo-soft.de:
index aRecord eq
Shouldn't that be 'sub' (not 'eq') if you want substring matches?
Did you miss the part where I pointed out that substring searches are not allowed on that attribute, because the schema definition doesn't allow them?
... "after changing it to 'caseExactIA5SubstringsMatch'" as implied...
--On Wednesday, December 13, 2006 1:10 PM +0100 Turbo Fredriksson turbo@bayour.com wrote:
Quoting Quanah Gibson-Mount quanah@stanford.edu:
--On Tuesday, December 12, 2006 5:08 PM +0100 Turbo Fredriksson turbo@bayour.com wrote:
Quoting "Jürgen Magin" gaston@octo-soft.de:
index aRecord eq
Shouldn't that be 'sub' (not 'eq') if you want substring matches?
Did you miss the part where I pointed out that substring searches are not allowed on that attribute, because the schema definition doesn't allow them?
... "after changing it to 'caseExactIA5SubstringsMatch'" as implied...
And I'm sure you know that changing RFC defined attribute definitions is highly frowned upon.
aRecord is defined in RFC1274 as:
# aRecord ATTRIBUTE # WITH ATTRIBUTE-SYNTAX # DNSRecordSyntax # ::= {pilotAttributeType 26}
and the RFC clearly states that the allowed matching rules for that type are:
DNSRecordSyntax ATTRIBUTE-SYNTAX IA5String MATCHES FOR EQUALITY
As in, no substring matching.
Telling people to willfully violate RFC defined attributes is generally a bad thing.
--Quanah
-- Quanah Gibson-Mount Principal Software Developer ITS/Shared Application Services Stanford University GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
--On Wednesday, December 13, 2006 9:26 AM +0100 Jürgen Magin gaston@octo-soft.de wrote:
Sorry guys the substring match is not the point of interest, because the whole string doesn't match too. Have a look to my last mail. :-) Thanks for your responds.
All I can say is, works for me.
I set up a test LDAP server, created a randomly generated entry:
# user.1, Accounts, example.com dn: uid=user.1,ou=Accounts,dc=example,dc=com objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: dNSZone givenName: Aaccf sn: Amar cn: Aaccf Amar initials: AA uid: user.1 mail: user.1@example.com telephoneNumber: 629-550-1330 homePhone: 599-075-3272 pager: 871-414-0149 mobile: 990-984-9327 employeeNumber: 1 street: 56091 West Street l: Salisbury st: GA postalCode: 12157 postalAddress: Aaccf Amar$56091 West Street$Salisbury, GA 12157 description: This is the description for Aaccf Amar. aRecord: 192.0.0.1
added an "eq" index for aRecord, created a junk schema to test with, and then added the entry.
The search works for me:
ldap-uat00:/tmp# ldapsearch -LLL -x -h localhost -b "dc=example,dc=com" arecord=192.0.0.1 dn: uid=user.1,ou=Accounts,dc=example,dc=com objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: dNSZone givenName: Aaccf sn: Amar cn: Aaccf Amar initials: AA uid: user.1 mail: user.1@example.com telephoneNumber: 629-550-1330 homePhone: 599-075-3272 pager: 871-414-0149 mobile: 990-984-9327 employeeNumber: 1 street: 56091 West Street l: Salisbury st: GA postalCode: 12157 postalAddress: Aaccf Amar$56091 West Street$Salisbury, GA 12157 description: This is the description for Aaccf Amar. aRecord: 192.0.0.1
--Quanah
-- Quanah Gibson-Mount Principal Software Developer ITS/Shared Application Services Stanford University GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
openldap-software@openldap.org