Solved

LDAP problem

Posted on 2002-06-29
6
1,213 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

758 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