[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Perl-Backend Proxy Problem
Bela Kovac wrote:
Hi all,
i'm trying to establish a kind of proxy with the perl-backend (It is
planned that the proxy will add some extra functionality in the
future, but for now it should simply forward queries). The proxy is
supposed to work like this:
1.) The (perl-backend) proxy gets a LDAP-query (ldapsearch from the
shell)
2.) The backend forwards the query to another LDAP-server
3.) The other LDAP-server responds to the backend
4.) The backend forwards the response to ldapsearch
So far steps 1 to 3 are running fine. That means that the perl-backend
knows the resulting data from the other LDAP-server. The problem i
have is that i cannot seem to take the last step, which means that the
data is lost and ldapsearch print just an "empty" LDIF result.
In the Sample.pm and manpage (man 5 slapd-perl) it is written (at
subroutine search) that results are returned in the format (
resultnumber, LDIF-entry, LDIF-entry, ... ). I'm not sure what
LDIF-entry exactly means:
Suppose i search for the cn's of some people and the perl-backend
knows the results. In what format do i have to return this data? I
tried the format to be in LDIF-format, which means
version: 1
dn:cn=MrX,ou=People,ou=someCompany
cn: Mister X
This doesn't work (even if i remove the first line "version: 1"). So
what format so i need? A simple string? An array? Hash? Object?
If someone could help me this would be great! If you need further
details of my problem just say so, i will try to explain further.
My (humble) suggestion is a bit off-topic, but let me state it anyway.
If you're familiar wwith C programming, you should try, for performance
and more, to use back-ldap with a custom overlay that does the extra you
need by playing with the results of your search (I guess you don't need
write operations, but of course you can handle them the same way).
If you need directions, feel free to ask, or to submit the overall view
of the
extra handling you need to do. I'm pretty sure this approach requires a bit
more skills that generic perl programming, but you would then benefit
of all the work that's been done on back-ldap instead of basically
reinventing
the wheel in perl.
p.
SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497