James Hughes
12/13/2005 9:50:00 PM
On 12/13/05, Daniel Berger <Daniel.Berger@qwest.com> wrote:
> James Hughes wrote:
>
> >
> > I need to use this control, but I can't figure out why this is
> > happening. This constant is mentioned in ldap.c:
> >
> > #ifdef LDAP_CONTROL_PAGEDRESULTS
> > rb_define_const (rb_mLDAP, "LDAP_CONTROL_PAGEDRESULTS",
> > rb_str_new2 (LDAP_CONTROL_PAGEDRESULTS));
> > #endif
> >
>
> That's a bug. Replace rb_str_new2 with INT2NUM.
Done, rebuilt the .so, no joy. Same error. I have verified that the
script is loading the correct shared lib by temporarily renaming it,
which causes the script to die at "require 'ldap'".
As I was about to send this response some of my gcc/make fu started
returning to me, and I added "-DLDAP_CONTROL_PAGEDRESULTS" to the
CPPFLAGS in the Makefile. Should have thought of that first.
But now the script dies with
"in `initialize': wrong argument type Fixnum (expected String) (TypeError)"
This is the offending line:
control = LDAP::Control.new(LDAP::LDAP_CONTROL_PAGEDRESULTS,
ber_string,
critical )
Anyone familiar with ruby-ldap know what's going on?
thanks,
jh
jh
--
James Hughes
Web application developer
Centre for Health Services and Policy Research
Vancouver, BC