summaryrefslogtreecommitdiff
path: root/libexec/spamd
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2003-03-30 01:50:22 +0000
committerBob Beck <beck@cvs.openbsd.org>2003-03-30 01:50:22 +0000
commit01b693b1187536c27f88918ff3848847fb4fee54 (patch)
tree155037a7c3de549ff2aeac72300b28201a949c34 /libexec/spamd
parent720b19337c6a8092269dc6a0ef3c7773768c506e (diff)
fix logging time to reflect reality. minus crack induced blank lines.
ok tholo@
Diffstat (limited to 'libexec/spamd')
-rw-r--r--libexec/spamd/spamd.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/libexec/spamd/spamd.c b/libexec/spamd/spamd.c
index 82a5158b89b..b4793cfc2ed 100644
--- a/libexec/spamd/spamd.c
+++ b/libexec/spamd/spamd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spamd.c,v 1.28 2003/03/28 20:35:24 beck Exp $ */
+/* $OpenBSD: spamd.c,v 1.29 2003/03/30 01:50:21 beck Exp $ */
/*
* Copyright (c) 2002 Theo de Raadt. All rights reserved.
@@ -72,6 +72,7 @@ struct con {
int obufalloc;
char *obuf;
+ char *lists;
size_t osize;
char *op;
int ol;
@@ -532,6 +533,10 @@ closecon(struct con *cp)
time(&t);
printf("%s connected for %d seconds.\n", cp->addr, t - cp->s);
}
+ if (cp->lists != NULL) {
+ free(cp->lists);
+ cp->lists = NULL;
+ }
if (cp->osize > 0 && cp->obufalloc) {
free(cp->obuf);
cp->obuf = NULL;
@@ -625,14 +630,16 @@ nextstate(struct con *cp)
spam:
case 50:
- syslog_r(LOG_INFO, &sdata, "%s: %s -> %s %ldsec by lists:%s",
- cp->addr, cp->mail, cp->rcpt, (long)(t - cp->s), doreply(cp));
+ cp->lists = strdup(doreply(cp));
cp->op = cp->obuf;
cp->ol = strlen(cp->op);
cp->state = 99;
cp->w = t + 1;
break;
case 99:
+ syslog_r(LOG_INFO, &sdata, "%s: %s -> %s %ldsec by lists:%s",
+ cp->addr, cp->mail, cp->rcpt, (long)(t - cp->s),
+ (cp->lists != NULL) ? cp->lists : "");
closecon(cp);
break;
default: