Log connections to syslog or stderr as appropriate. 1.0.0
authormdw <mdw>
Sat, 3 Jul 1999 13:56:59 +0000 (13:56 +0000)
committermdw <mdw>
Sat, 3 Jul 1999 13:56:59 +0000 (13:56 +0000)
identify.c

index db6df93..86cd594 100644 (file)
@@ -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
  *
 /*----- 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 --- */