Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Applying filters on LDIF entries
Hi,

I would like to know if I can apply a Net::LDAP::Filter object
to a Net::LDAP::Entry object and see if it succeeds. I can see
no documentation that it is, so would like confirmation.=20

Basically my aim is to search a huge ldif dump when possible,
rather than hit the directory everytime.

Thanks
Gautam

Report this thread to moderator Post Follow-up to this message
Old Post
Gautam Gopalakrishnan
04-22-05 09:05 PM


Re: Applying filters on LDIF entries
Hi,

On Friday 22 April 2005 15:48, Gautam Gopalakrishnan wrote:
> I would like to know if I can apply a Net::LDAP::Filter object
> to a Net::LDAP::Entry object and see if it succeeds. I can see
> no documentation that it is, so would like confirmation.

AFAIK there is no such possibility.
The ability to search for objects is part of the features thet an LDAP serve
r
provides.

> Basically my aim is to search a huge ldif dump when possible,
> rather than hit the directory everytime.
Why ?
That's what LDAP srvers are for.

Peter
--
Peter Marschall
eMail: peter@adpm.de

Report this thread to moderator Post Follow-up to this message
Old Post
Peter Marschall
04-22-05 09:05 PM


Re: Applying filters on LDIF entries
On 4/23/05, Peter Marschall <peter@adpm.de> wrote:
> On Friday 22 April 2005 15:48, Gautam Gopalakrishnan wrote: 
> Why ?
> That's what LDAP srvers are for.

Some attributes don't change values very often and sometime you don't
need the latest information? Maybe it's just me, but I thought this
would be useful. I've started coding it, just for the challenge.

Cheers
Gautam

Report this thread to moderator Post Follow-up to this message
Old Post
Gautam Gopalakrishnan
04-22-05 09:05 PM


Re: Applying filters on LDIF entries
Hi,

On Friday 22 April 2005 17:35, Gautam Gopalakrishnan wrote:
> Some attributes don't change values very often and sometime you don't
> need the latest information? Maybe it's just me, but I thought this
> would be useful. I've started coding it, just for the challenge.

You may use ldifgrep (http://sourceforge.net/projects/ldifgrep).
It's a perl script that greps the entries from an LDIF file where
the arguments matches an attribute's value

The problem for applying filters on LDIF entries is that you do not
know about the syntaxes of the attributes and thus do not know
how to compare the values.

An extreme example is certificateMatch as it is implemented in OpenLDAP 2.2:
A filter like
(userCertificate=2$EMAIL=joe@example.com,CN=John Doe,O=Example\5C,Ltd.,C=US)
finds objects that have the userCertificate attribute filled with a X.509
certificate with serial number 2 and the subject DN (in the X.509 notation)
/C=US/O=Example\5C,Ltd./CN=John Doe/EMAIL=joe@example.com

Trying to do things like that on LDIF files is quite hard IMHO (and one of t
he
major steps towards an LDAP server in Perl ;-)

Have fun
Peter
--
Peter Marschall
eMail: peter@adpm.de

Report this thread to moderator Post Follow-up to this message
Old Post
Peter Marschall
04-22-05 09:05 PM


Re: Applying filters on LDIF entries
On 4/23/05, Peter Marschall <peter@adpm.de> wrote:
> On Friday 22 April 2005 17:35, Gautam Gopalakrishnan wrote: 
>=20
> You may use ldifgrep (http://sourceforge.net/projects/ldifgrep).
> It's a perl script that greps the entries from an LDIF file where
> the arguments matches an attribute's value

Not good enough :-(

> The problem for applying filters on LDIF entries is that you do not
> know about the syntaxes of the attributes and thus do not know
> how to compare the values.

I'm just using Net::LDAP::LDIF to usurp entries. I have some sample
code which works. Net::LDAP::Filter also eliminates most of the work
involved. Currently it implements just the operations I use at work
(and, or, exists and substrings). The code is slow mainly because
Net::LDAP::LDIF is slow. Parsing about 116000 entries takes about
20 minutes, of which 72% is spent inside Net::LDAP::LDIF. But it works.

http://www-personal.monash.edu.au/~...fsearch.pl.html

> Have fun

I am :-) Any kind of feedback is welcome.

Cheers
Gautam

Report this thread to moderator Post Follow-up to this message
Old Post
Gautam Gopalakrishnan
04-23-05 01:58 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

LDAP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:25 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.