summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-09-18 02:58:02 +0000
committerStef Walter <stef@memberwebs.com>2004-09-18 02:58:02 +0000
commit98cdb12dfeed4f370fee79eb41a3e8a94ef7f2a9 (patch)
treee4d7bc49701f6e6d26140c15c4bd6c7398c1b077 /src
parent9992298ca9a1549ab3267506896852f9df0369ee (diff)
log messages don't work once forked.
Diffstat (limited to 'src')
-rw-r--r--src/clamsmtpd.c9
1 files 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;
};