On Sunday, 22. April 2012, Alexei Znamensky wrote:
> Hi Peter,
> On 22 April 2012 15:10, Peter Marschall <pe...@adpm.de> wrote:
> > [...]
> In that case, why does Net::LDAP::Filter constructor accepts such filters
> as argument? Shouldn't it moan that this is illegal? It builds an object
> out of that filter. If that is not a legal filter, a Filter object should
> not be created out of it.
Net::LDAP::Filter only checks for "well-formedness".
> > LDAP RFCs do not define filters with DN on the left hand side.
> Is there a good reason for that?
I guess you need to aks that to the people who created the RFCs
(i.e. the standards) for LDAP.
One possible explatation might be:
If you have the name of the object, you can make a more efficient query:
$ldap->search(base => $YOUR_KNOWN_DN,
filter => '(objectclass=*)',
scope => base);
I.e. you set the search base to your known DN, set the scope to 'base',
(i.e. only the object given as base) and query for all objects.
This gives you the most efficient query if you already know a DN.
=> Using the DN alone on the left hand side of a filter is simply not
I am fully aware of DN as part of the left hand side in extensible matches.
But in those cases the filter searches for specific values of RDNs as parts of
the DN, not the full DN.
> > [...]
> > The filters using DN would fail on a standard LDAP server too.
> > Net::LDAP::FilterMatch behaves correctly.
> I was afraid that would be the case.
> I personally can see no reason why we should not be able to perform
> searches based on the object name. It seems silly that I can search by
> anything else but the very name of the object.