[Date Prev][Date Next]
Is ldap_bind() mandatory before each ldap_search() call?
- To: firstname.lastname@example.org
- Subject: Is ldap_bind() mandatory before each ldap_search() call?
- From: Shankar Anand R <email@example.com>
- Date: Mon, 8 Nov 2010 22:19:38 +0530
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=Z8yavMlun9dDBAofXqgqDmLlSP0tDGh7grQmGzELAYs=; b=mWSjqZJ1wAUMSRKsa59co1YTHnWMkJhK/558ZBsclBVUV+fwQmshEy7gM/RKd0ucQ1 ju74d06aHiy6AmsrIF98oyqFjNtAIiMdwaytY7bJ2Lhi2h9nOmqHHGkgLKp2rQgijanA g32DmaOW893LgMVzyjL0S9ckn6qcBO0koFbok=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=BpvkhQzO5jSN9hFLFBDViIW1lVRd7LEVH/0ETrvH5yPEBb3KzKjqqbKU12qgfdNXyX mGAQSnWqxqNza8OsSmgP5Y5qPfEuLgiMg9lg/fMAGCHT9JN1LEeXbRK6+r8dDjlKi4/t g2i1U11l1O8WLLiKmZ4+Bq0NV751RCCEVVl/c=
I see that most LDAP utilities (openldap included) do a ldap_bind() before every ldap_search(). Is this mandatory?
If LDAP descriptor (ld) is valid and can be used for multiple ldap_search() calls, when does it become invalid? Is it time based, say ld becomes invalid after 10 minutes?
I have an application which needs to search the LDAP server for some specific attributes of users. The user name is taken as input from the command line. Is it necessary to do a ldap_bind() before each ldap_search() call? Doesn't this make it costly?
Can I do ldap_bind() once and call ldap_search() many times? When does my "bind" become invalid?
Can my application do this:
#1 - bind to a LDAP server during initialization
#2- then do an ldap_search() whenever required
#3- then invalidate the ld after 10 minutes
#4- do a ldap_bind() again and repeat from #2?
Can someone kindly clarify?