[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: OT: Please help debuging problems with smba3



Hi lit,
hi Kurt ...

Kurt D. Zeilenga schrieb:
At 05:23 AM 1/12/2005, Harry Rüter wrote:



For help on the Samba particulars, I suggest you
post to the Samba list.

I did it already ...

However, your questions about
how certain OpenLDAP client library functions behave is
actually quite on topic.  You, however, just need to
bridge the gap of knowledge... (don't expect anyone here
to know anything about Samba).

No, don't want to bore you with samba-questions !


So, i'm trying to find out what's wrong in the samba-code,
and i set some DEBUG statements in the smaba-sources.


Have you verified that the operations you think the code
is performing can be performed using OpenLDAP command line
tools?

Yes, ldapsearch with simpleauth works (and should work in samba but doesn't, that's the problem).


For instance, if you are having trouble with simple bind,
is it just with the code or can you reproduce the problem
with ldapwhoami(1) or ldapsearch(1)?

Just with the code ... see above



The code i'm working with is (sorry, wrapped because of the mailer):
---snipp---
rc = ldap_simple_bind_s(ldap_struct, ldap_dn, ldap_secret);


How was ldap_struct declared and initialized?


if (rc != LDAP_SUCCESS)
{
char *ld_error = NULL;
ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_ERROR_STRING,
                              &ld_error);
DEBUG(ldap_state->num_failures ? 2 : 0,
                 ("failed to bind to server with dn= %s Error:%s\n\t%s\n",
                             ldap_dn ? ldap_dn : "(unknown)", ldap_err2string(rc),
                             ld_error ? ld_error : "(unknown)"));


It makes no sense to call ldap_err2string with rc, as rc is not an
error number, -1 here is just an error indicator.

Okay.

One has to use ldap_get_option w/ LDAP_OPT_ERROR_NUMBER to get the actual error
number.

Okay.

Or use the ldap_sasl_bind_s(3) (w/ LDAP_SASL_SIMPLE for
simple bind) as this call does return the error number.

Will try this.

See draft-ietf-ldapext-ldap-c-api for details here.

Okay.


Now i wanna know, what's in  ldap_struct,
but i can't find the type-definition of this struct.


It's opaque by design.

Sorry, i'm not a professional programmer, what does this terminus mean ?


So, and here's my request,
could someone send the definition of this struct,
so i can use it in further debug-statements.


You can look in the internal headers for its definition.

Yes, in openldap-2.2.20/include/ldap.h i found:

typedef struct ldap LDAP;

But where's the struct,
couldn't find the "real" struct ...

Would be fine if you could give me a hint,
where in the sources i can find the complete struct.
In the man-pages for ldap_init i just could find a
minimal version :

typedef struct ldap {
   /* ... other stuff you should not mess with ... */
  char	   ld_lberoptions;
  ....
}

greets Harry


PS.: It's sure a samba problem, but for further investigations i need your help, to understand the ldap-portion of the samba-sources ...