From 98cdb12dfeed4f370fee79eb41a3e8a94ef7f2a9 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 18 Sep 2004 02:58:02 +0000 Subject: log messages don't work once forked. --- src/clamsmtpd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/clamsmtpd.c b/src/clamsmtpd.c index 591db3a..f1d6e75 100644 --- a/src/clamsmtpd.c +++ b/src/clamsmtpd.c @@ -659,6 +659,9 @@ static int virus_action(clctx_t* ctx, const char* virus) if(g_clstate.virusaction != NULL) { + + sp_messagex(sp, LOG_DEBUG, "executing virus action: %s", g_clstate.virusaction); + switch(pid = fork()) { case -1: @@ -688,13 +691,11 @@ static int virus_action(clctx_t* ctx, const char* virus) if(virus) setenv("VIRUS", virus, 1); - sp_messagex(sp, LOG_DEBUG, "executing virus action: %s", g_clstate.virusaction); - /* And execute the program */ execl("/bin/sh", "sh", "-c", g_clstate.virusaction, NULL); - /* If that returned then there was an error */ - sp_message(sp, LOG_ERR, "error executing the shell for virus action"); + /* If that returned then there was an error, but there's + * not much we can do about it. */ exit(1); break; }; -- cgit v1.2.3