From: Dick Davies Date: 2005-03-11T20:38:31+09:00 Subject: Re: ruby-ldap rebinding ? * Ian Macdonald [0345 06:45]: > On Thu 10 Mar 2005 at 20:46:51 +0900, Dick Davies wrote: > > get user and pass > > open connection to server > > bind anonymously > > map the user to a dn > > bind as dn and pass <- this goes boom > > > > when I rebind I get an error. Here's a cut down version: > > > > $ irb -r ldap > > irb(main):001:0> conn = LDAP::SSLConn.new('ldap.server',389,true) > > => # > > irb(main):002:0> a = conn.bind > > => # > > irb(main):003:0> a.unbind > > => nil > > irb(main):004:0> b = conn.bind > > LDAP::InvalidDataError: The LDAP handler is already unbind()'ed. > > from (irb):4:in `bind' > > from (irb):4 > > if I omit the unbind(), I get 'The LDAP handler is already binded' > Conn#unbind doesn't just unbind from the server; it also destroys the > connection object when it calls ldap_unbind(). > > From ldap_unbind(3): > > UNBINDING > The ldap_unbind() call is used to unbind from the directory, Ok thanks - I've used Perl::LDAP in the past which lets you rebind and existing connection. Can I do that with ruby-ldap, or do I need a new connection every time I check a username/password pair? -- 'Oh, wait you're serious. Let me laugh even harder.' -- Bender Rasputin :: Jack of All Trades - Master of Nuns