On Thu, Nov 22, 2012 at 11:01:47AM +0100, Petr Spacek wrote:
> One day I will forgot my head somewhere ... the patch is attached.
> 
> On 11/22/2012 10:57 AM, Petr Spacek wrote:
> >Hello,
> >
> >     Remove dead assignment and add logging to ldap_pool_connect().
> >
> >     Dead assignment was reported by Clang static code analysis.
> >
> 
> -- 
> Petr^2 Spacek

Ack

> From 0a10518a20e5ef0f0a8767d47d3306644cf2c636 Mon Sep 17 00:00:00 2001
> From: Petr Spacek <[email protected]>
> Date: Thu, 22 Nov 2012 10:48:45 +0100
> Subject: [PATCH] Remove dead assignment and add logging to
>  ldap_pool_connect().
> 
> Dead assignment was reported by Clang static code analysis.
> 
> Signed-off-by: Petr Spacek <[email protected]>
> ---
>  src/ldap_helper.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/ldap_helper.c b/src/ldap_helper.c
> index 
> 407875a4f7e5952272e496ed70b18b772172bfb3..e537d9b3b76c6a7144ee7df1ddda26ed95b4ab0d
>  100644
> --- a/src/ldap_helper.c
> +++ b/src/ldap_helper.c
> @@ -3094,18 +3094,18 @@ ldap_pool_connect(ldap_pool_t *pool, ldap_instance_t 
> *ldap_inst)
>               ldap_conn = NULL;
>               CHECK(new_ldap_connection(pool, &ldap_conn));
>               result = ldap_connect(ldap_inst, ldap_conn, ISC_FALSE);
> -             if (result == ISC_R_NOTCONNECTED || result == ISC_R_TIMEDOUT) {
> -                     /* LDAP server is down which can happen, continue */
> -                     result = ISC_R_SUCCESS;
> -             } else if (result != ISC_R_SUCCESS) {
> +             /* Continue even if LDAP server is down */
> +             if (result != ISC_R_NOTCONNECTED && result != ISC_R_TIMEDOUT &&
> +                 result != ISC_R_SUCCESS) {
>                       goto cleanup;
>               }
>               pool->conns[i] = ldap_conn;
>       }
>  
>       return ISC_R_SUCCESS;
>  
>  cleanup:
> +     log_error_r("couldn't establish connection in LDAP connection pool");
>       for (i = 0; i < pool->connections; i++) {
>               destroy_ldap_connection(&pool->conns[i]);
>       }
> -- 
> 1.7.11.7
> 


-- 
Adam Tkac, Red Hat, Inc.

_______________________________________________
Freeipa-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to