FW: Winbindd timeout on unreacheable domains

Andrew Smith-MAGAZINES andrew.smith.06 at bbc.co.uk
Thu Feb 19 18:30:27 GMT 2004


Hi Lin,

	many thanks, I've just tested this with Samba 3.0.2 and it also works for me. Is anyone able to technically endorse the fix Lin has applied, as I haven't researched the details or implications of these two different functions?

Jerry, I checked bug 704, which is assigned to you, but no action has been taken for this. Is there any target for resolving this issue? Are you happy to implement Lin's fix?

		thanks Andy.

-----Original Message-----
From: Lin Li [mailto:linl at xandros.com]
Posted At: 19 February 2004 15:01
Posted To: Samba
Conversation: FW: Winbindd timeout on unreacheable domains
Subject: Re: FW: Winbindd timeout on unreacheable domains


Lin Li wrote:

> In fact I have logged a bug (#704) for this. It's doing 
> ads_try_connect(). My solution is to use ldap_init() instead of 
> ldap_open() and set a small timeout using ldap_set_option(). Here is 
> my patch (I'm using 3.0.0) and it works in my test.
> -------------------------------------
> +       struct timeval timeout;
>
>        if (!server || !*server) {
>                return False;
> @@ -58,11 +59,15 @@
>        /* this copes with inet_ntoa brokenness */
>        srv = strdup(server);
>
> -       ads->ld = ldap_open(srv, port);
> +       ads->ld = ldap_init(srv, port);
>        if (!ads->ld) {
>                free(srv);
>                return False;
>        }
> +
> +       timeout.tv_sec = 15;
> +       timeout.tv_usec = 0;
> +       ldap_set_option(ads->ld, LDAP_OPT_NETWORK_TIMEOUT, &timeout);
>        ads->ldap_port = port;
>        ads->ldap_ip = *interpret_addr2(srv);
>        free(srv);
> -------------------------------------
>
> Thanks,
> Lin
>
Sorry, the patch is for source/libads/ldap.c

Thanks,
Lin

-- 
Xandros Corporation
Simple. Powerful. Linux.
Visit us at http://www.xandros.com




More information about the samba-technical mailing list