bb12522: Fix freshclam db test in daemon mode

Database validation was broken when running daemon mode.
The source of this bug was a mistake when overhauling freshclam.
The freshclam overhaul accidentally removed the call to disable
waiting for child processes in the global signal handler.
This patch fixes the issue by disabling the wait prior to the
fork to test the database.
pull/142/head^2
Micah Snyder (micasnyd) 5 years ago
parent 4216c6aa41
commit ade9352d9a
  1. 9
      freshclam/freshclam.c

@ -281,6 +281,14 @@ fc_error_t download_complete_callback(const char *dbFilename, void *context)
goto done;
}
} else {
/*
* Attempt to test database in a child process.
*/
/* We need to be able to wait for the child process ourselves.
* We'll re-enable wait in the global handler when we're done. */
g_sigchildWait = 0;
switch (pid = fork()) {
case -1: {
/*
@ -392,6 +400,7 @@ done:
logg("!Database test FAILED.\n");
}
/* Re-enable the global handler's child process wait */
g_sigchildWait = 1;
return status;

Loading…
Cancel
Save