merge 3.0 -> 3.1, #4
authorAleš Křenek <ljocha@ics.muni.cz>
Mon, 26 Feb 2007 16:41:02 +0000 (16:41 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Mon, 26 Feb 2007 16:41:02 +0000 (16:41 +0000)
org.glite.lb.server/config/startup
org.glite.lb.server/src/bkserverd.c

index fe09868..597ddaf 100755 (executable)
@@ -48,6 +48,7 @@ start()
                [ -d "$GLITE_LB_EXPORT_JPREG_MAILDIR" ] || mkdir -p "$GLITE_LB_EXPORT_JPREG_MAILDIR" && chown $GLITE_USER:$GLITE_GROUP -R "$GLITE_LB_EXPORT_JPREG_MAILDIR"
                maildir="--jpreg-dir $GLITE_LB_EXPORT_JPREG_MAILDIR"
        fi
+       super="--super-users-file $GLITE_LOCATION/etc/LB-super-users"
 
        [ -z "$creds" ] && echo $0: WARNING: No credentials specified. Using default lookup which is dangerous. >&2
 
@@ -59,7 +60,7 @@ start()
        su - $GLITE_USER -c "$GLITE_LOCATION/bin/glite-lb-bkserverd \
                --notif-il-sock=$GLITE_LB_NOTIF_SOCK \
                --notif-il-fprefix=$GLITE_LB_NOTIF_FPREFIX \
-               $creds -i $pidfile $port $wport $dumpdir $purgedir $maildir" \
+               $super $creds -i $pidfile $port $wport $dumpdir $purgedir $maildir" \
        && echo " done" || echo " FAILED"
 
        echo -n Starting glite-lb-notif-interlogd ...
index c2d6a26..af8c756 100644 (file)
@@ -815,6 +815,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;
        }
        
@@ -883,22 +885,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);
@@ -1423,8 +1425,9 @@ static int read_roots(const char *file)
        int     cnt = 0;
 
        if (!roots) {
-               perror(file);
-               return 1;
+               syslog(LOG_WARNING,"%s: %m, continuing without --super-users-file",file);
+               dprintf(("%s: %s, continuing without --super-users-file\n",file,strerror(errno)));
+               return 0;
        }
 
        while (!feof(roots)) {