LDAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesLDAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old January 17th, 2008, 05:36 AM
Briareos Briareos is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Posts: 2 Briareos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m 50 sec
Reputation Power: 0
Choosing the source IP address for an LDAP connection

Hi,

I must run an LDAP client program (using OpenLDAP 2.2.6) on a multi-homed host, i.e. one with several network interfaces/IP addresses. For network security reasons, the connection to the LDAP server must be established through a specific source IP address.

Much as I have browsed through the OpenLDAP documentation, I have been unable to find a way to choose the source IP address when setting up the LDAP connection to the server The result is that my program just uses any source IP address, which means nothing works if the chosen IP happens not to be the "right" one.

I've Googled myself to death looking for the way to do it with no success so far.

Does anyone know how I may select the source IP address when setting up an LDAP client connection using OpenLDAP 2.2.6?

Thanks a lot,


Briareos

Reply With Quote
  #2  
Old January 30th, 2008, 09:54 AM
Briareos Briareos is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Posts: 2 Briareos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m 50 sec
Reputation Power: 0
In OpenLDAP 2.4 there is a function that should do the trick:

Code:
int ldap_init_fd(fd, proto, uri, ldp)
       ber_socket_t fd;
       int proto;
       char *uri;
       LDAP **ldp;


You establish the TCP connection beforehand, binding it to the local IP address of your choosing, then use the resulting socket to build the LDAP connection over it. Compared to the function I was using

Code:
int ldap_initialize(ldp, uri)
       LDAP **ldp;
       char *uri;


ldap_init_fd() is a bit of a nuisance because you have to parse the LDAP URI and perform the name resolution yourself but that's OK with me.

The problem is that, as far as I can tell, neither ldap_init_fd() or nor an equivalent function are available in OpenLDAP 2.2.6, which is the version I must work with.

Any ideas?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesLDAP Programming > Choosing the source IP address for an LDAP connection


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway