Solved

LDAP problem

Posted on 2002-06-29
6
1,221 Views
Last Modified: 2007-12-19
Any one tried ldap_init() function??? I am using this function but getting a problem.

If i call ldap_init(host_name, host_port) then value for field ld_host in returned LADPObj is NULL and any further
API call like ldap_set_option() crash down the system.

If i use ldap_open(host_name, host_port) it's initialized properly, but then I can't use ldap_set_option() function.

Please help me to solve out this problem, plz plz plz ...
0
Comment
Question by:haider
  • 3
  • 2
6 Comments
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 100 total points
ID: 7118253
Usually  ladp_init works. See, for example:
http://samba.org/doxygen/samba/head/pdb__ldap_8c-source.html  Or
http://docs.iplanet.com/docs/manuals/dirsdk/csdk41/relnotes.htm
But, if it is NULL, you can use  ldap_open
As:

   /* Initialize the LDAP context. */
  if( ( ldap = ldap_init(ctxt->server, LDAP_PORT)) == NULL ) {
  if( ( ldap = ldap_open(ctxt->server, LDAP_PORT)) == NULL ) {
     //error message: "couldn't initialize LDAP"
     return 1;
   }
, set some flag and don't use ldap_set_option...


0
 

Author Comment

by:haider
ID: 7118313
, set some flag and don't use ldap_set_option...

how to set flag if I don't use ldap_set_option()???
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 7118427
O,sorry,really, you can use ldap_set_option after ldap_open
BUT:
>>If i use ldap_open(host_name, host_port) it's >>initialized properly, but then I can't use >>ldap_set_option() function
???
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Author Comment

by:haider
ID: 7118436
but when I try to use ldap_set_option after ldap_open then it hangs out on ldap_set_option. what is the reason???
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 7119579
Can see snippet of your code?
0
 
LVL 11

Expert Comment

by:griessh
ID: 7262534
Dear haider

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to

     "PAQ at zero points"

since you never gave more feedback.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question