From 793f69cd9f2888aa571d3c3d8fe8c0d1bd8ee483 Mon Sep 17 00:00:00 2001 From: mdw Date: Sat, 3 Jul 1999 13:56:59 +0000 Subject: [PATCH] Log connections to syslog or stderr as appropriate. --- identify.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/identify.c b/identify.c index db6df93..86cd594 100644 --- a/identify.c +++ b/identify.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: identify.c,v 1.1 1999/07/01 08:56:23 mdw Exp $ + * $Id: identify.c,v 1.2 1999/07/03 13:56:59 mdw Exp $ * * Identifies and logs the client of a connection * @@ -29,8 +29,11 @@ /*----- Revision history --------------------------------------------------* * * $Log: identify.c,v $ - * Revision 1.1 1999/07/01 08:56:23 mdw - * Initial revision + * Revision 1.2 1999/07/03 13:56:59 mdw + * Log connections to syslog or stderr as appropriate. + * + * Revision 1.1.1.1 1999/07/01 08:56:23 mdw + * Initial revision. * */ @@ -125,8 +128,15 @@ static void id_done(id *i) tm = localtime(&i->when); strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm); - syslog(LOG_NOTICE, "%s %s %s from %s@%s\n", - buf, i->q.desc, i->q.act, i->user, i->host); + if (flags & FW_SYSLOG) { + syslog(LOG_NOTICE, "%s %s %s from %s@%s [%s]\n", + buf, i->q.desc, i->q.act, + i->user, i->host, inet_ntoa(i->q.rsin.sin_addr)); + } else { + fprintf(stderr, "%s %s %s from %s@%s [%s]\n", + buf, i->q.desc, i->q.act, + i->user, i->host, inet_ntoa(i->q.rsin.sin_addr)); + } /* --- Dispose of the block --- */ -- 2.11.0