add new directive ExitOnOOM

git-svn: trunk@1073
remotes/push_mirror/metadata
Tomasz Kojm 21 years ago
parent 4b187745e4
commit f9593781a5
  1. 10
      clamav-devel/ChangeLog
  2. 2
      clamav-devel/clamd/server-th.c
  3. 12
      clamav-devel/clamd/session.c
  4. 6
      clamav-devel/docs/man/clamd.conf.5.in
  5. 3
      clamav-devel/etc/clamd.conf
  6. 1
      clamav-devel/shared/cfgparser.c

@ -1,3 +1,13 @@
Mon Nov 8 15:24:18 CET 2004 (tk)
---------------------------------
* clamd: new directive ExitOnOOM (stop deamon when libclamav reports out of
memory condition)
Mon Nov 8 11:32:11 CET 2004 (tk)
---------------------------------
* clamd/server-th.c: SIGHUP: also re-open log file closed due to exceeded
file size
Mon Nov 8 10:29:02 GMT 2004 (njh)
----------------------------------
* libclamav/message.c: Fix crash if the guessed encoder is incorrectly

@ -482,6 +482,8 @@ int acceptloop_th(int socketd, struct cl_node *root, const struct cfgstruct *cop
logg("SIGHUP caught: re-opening log file.\n");
logg_close();
sighup = 0;
if(!logg_file && (cpt = cfgopt(copt, "LogFile")))
logg_file = cpt->strarg;
}
if (!progexit && new_sd >= 0) {

@ -94,12 +94,14 @@ int command(int desc, const struct cl_node *root, const struct cl_limits *limits
if(!strncmp(buff, CMD1, strlen(CMD1))) { /* SCAN */
if(scan(buff + strlen(CMD1) + 1, NULL, root, limits, options, copt, desc, 0) == -2)
return COMMAND_SHUTDOWN;
if(cfgopt(copt, "ExitOnOOM"))
return COMMAND_SHUTDOWN;
} else if(!strncmp(buff, CMD2, strlen(CMD2))) { /* RAWSCAN */
opt = options & ~CL_SCAN_ARCHIVE;
if(scan(buff + strlen(CMD2) + 1, NULL, root, NULL, opt, copt, desc, 0) == -2)
return COMMAND_SHUTDOWN;
if(cfgopt(copt, "ExitOnOOM"))
return COMMAND_SHUTDOWN;
} else if(!strncmp(buff, CMD3, strlen(CMD3))) { /* QUIT */
return COMMAND_SHUTDOWN;
@ -113,7 +115,8 @@ int command(int desc, const struct cl_node *root, const struct cl_limits *limits
} else if(!strncmp(buff, CMD6, strlen(CMD6))) { /* CONTSCAN */
if(scan(buff + strlen(CMD6) + 1, NULL, root, limits, options, copt, desc, 1) == -2)
return COMMAND_SHUTDOWN;
if(cfgopt(copt, "ExitOnOOM"))
return COMMAND_SHUTDOWN;
} else if(!strncmp(buff, CMD7, strlen(CMD7))) { /* VERSION */
const char *dbdir;
@ -147,7 +150,8 @@ int command(int desc, const struct cl_node *root, const struct cl_limits *limits
} else if(!strncmp(buff, CMD8, strlen(CMD8))) { /* STREAM */
if(scanstream(desc, NULL, root, limits, options, copt) == CL_EMEM)
return COMMAND_SHUTDOWN;
if(cfgopt(copt, "ExitOnOOM"))
return COMMAND_SHUTDOWN;
} else if(!strncmp(buff, CMD9, strlen(CMD9))) { /* SESSION */
do {

@ -135,6 +135,12 @@ Execute the COMMAND when virus is found. In the command string %v will be replac
.br
Default: disabled
.TP
\fBExitOnOOM\fR
Stop deamon when libclamav reports out of memory condition.
.br
Default: disabled
.TP
.TP
\fBUser STRING\fR
Run as selected user.
.br

@ -136,6 +136,9 @@ FixStaleSocket
# Default: disabled
#AllowSupplementaryGroups
# Stop deamon when libclamav reports out of memory condition.
#ExitOnOOM
# Don't fork into background.
# Default: disabled
#Foreground

@ -90,6 +90,7 @@ struct cfgstruct *parsecfg(const char *cfgfile, int messages)
{"MaxDirectoryRecursion", OPT_NUM},
{"FollowDirectorySymlinks", OPT_NOARG},
{"FollowFileSymlinks", OPT_NOARG},
{"ExitOnOOM", OPT_NOARG},
{"Foreground", OPT_NOARG},
{"Debug", OPT_NOARG},
{"LeaveTemporaryFiles", OPT_NOARG},

Loading…
Cancel
Save