From dbad86624c4045d0708dd372153158eaafb39d2a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Sun, 11 Feb 2007 15:53:24 +0000 Subject: [PATCH] fix for #22879 -- log hostname/IP of the peer in case of GSS failure --- org.glite.lb.server/src/bkserverd.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/org.glite.lb.server/src/bkserverd.c b/org.glite.lb.server/src/bkserverd.c index 77132c9..3ee00ab 100644 --- a/org.glite.lb.server/src/bkserverd.c +++ b/org.glite.lb.server/src/bkserverd.c @@ -771,6 +771,8 @@ int bk_handle_connection(int conn, struct timeval *timeout, void *data) default: if (debug) fprintf(stderr, "gethostbyaddr(%s): %s", inet_ntoa(a.sin_addr), hstrerror(h_errno)); dprintf(("[%d] connection from %s:%d\n", getpid(), inet_ntoa(a.sin_addr), ntohs(a.sin_port))); + free(ctx->connPool[ctx->connToUse].peerName); + ctx->connPool[ctx->connToUse].peerName = strdup(inet_ntoa(a.sin_addr)); break; } @@ -839,22 +841,22 @@ int bk_handle_connection(int conn, struct timeval *timeout, void *data) { if ( ret == EDG_WLL_GSS_ERROR_TIMEOUT ) { - dprintf(("[%d] Client authentication failed - timeout reached, closing.\n", getpid())); - if (!debug) syslog(LOG_ERR, "Client authentication failed - timeout reached"); + dprintf(("[%d] %s: Client authentication failed - timeout reached, closing.\n", getpid(),ctx->connPool[ctx->connToUse].peerName)); + if (!debug) syslog(LOG_ERR, "%s: Client authentication failed - timeout reached",ctx->connPool[ctx->connToUse].peerName); } else if (ret == EDG_WLL_GSS_ERROR_GSS) { edg_wll_SetErrorGss(ctx,"Client authentication",&gss_code); if (strstr(ctx->errDesc,_EXPIRED_CERTIFICATE_MESSAGE)) { - dprintf(("[%d] false expired certificate: %s\n",ctx->errDesc)); - if (!debug) syslog(LOG_ERR,"false expired certificate: %s",ctx->errDesc); + dprintf(("[%d] %s: false expired certificate: %s\n",getpid(),ctx->connPool[ctx->connToUse].peerName,ctx->errDesc)); + if (!debug) syslog(LOG_ERR,"[%d] %s: false expired certificate: %s",getpid(),ctx->connPool[ctx->connToUse].peerName,ctx->errDesc); edg_wll_FreeContext(ctx); return -1; } } else { - dprintf(("[%d] Client authentication failed, closing.\n", getpid())); - if (!debug) syslog(LOG_ERR, "Client authentication failed"); + dprintf(("[%d] %s: Client authentication failed, closing.\n", getpid(),ctx->connPool[ctx->connToUse].peerName)); + if (!debug) syslog(LOG_ERR, "%s: Client authentication failed",ctx->connPool[ctx->connToUse].peerName); } edg_wll_FreeContext(ctx); -- 1.8.2.3