Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1240
  • Last Modified:

LDAP problem

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
haider
Asked:
haider
  • 3
  • 2
1 Solution
 
AlexVirochovskyCommented:
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
 
haiderAuthor Commented:
, set some flag and don't use ldap_set_option...

how to set flag if I don't use ldap_set_option()???
0
 
AlexVirochovskyCommented:
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
haiderAuthor Commented:
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
 
AlexVirochovskyCommented:
Can see snippet of your code?
0
 
griesshCommented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now