Solved

LDAP problem

Posted on 2002-06-29
6
1,217 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now