Solved

LDAP problem

Posted on 2002-06-29
6
1,226 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
Technology Partners: 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!

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IdTelnet1DataAvailable handler freezes the Application 4 92
PDF library for Delphi 2 135
Dialogbox API leak? 18 109
Eclipse IDE - Cannot copy/paste from console output 8 314
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

749 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