From 68dbfcd9e75f692588666a06bd2a205f80c711d3 Mon Sep 17 00:00:00 2001 From: Tomasz Kojm Date: Wed, 15 Jul 2009 19:37:30 +0200 Subject: [PATCH] clamd: honour value of 0 in Max* options --- ChangeLog | 4 ++++ clamd/server-th.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b74b56ba..0ea464f27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Jul 15 19:36:35 CEST 2009 (tk) +---------------------------------- + * clamd: honour value of 0 in Max* options + Wed Jul 15 19:24:03 CEST 2009 (tk) ---------------------------------- * clamscan: honour value of 0 in --max-* options (bb#1650) diff --git a/clamd/server-th.c b/clamd/server-th.c index eecee0965..5d23552f6 100644 --- a/clamd/server-th.c +++ b/clamd/server-th.c @@ -718,7 +718,7 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi #endif /* set up limits */ - if((opt = optget(opts, "MaxScanSize"))->enabled) { + if((opt = optget(opts, "MaxScanSize"))->active) { if((ret = cl_engine_set_num(engine, CL_ENGINE_MAX_SCANSIZE, opt->numarg))) { logg("!cl_engine_set_num(CL_ENGINE_MAX_SCANSIZE) failed: %s\n", cl_strerror(ret)); cl_engine_free(engine); @@ -731,7 +731,7 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi else logg("^Limits: Global size limit protection disabled.\n"); - if((opt = optget(opts, "MaxFileSize"))->enabled) { + if((opt = optget(opts, "MaxFileSize"))->active) { if((ret = cl_engine_set_num(engine, CL_ENGINE_MAX_FILESIZE, opt->numarg))) { logg("!cl_engine_set_num(CL_ENGINE_MAX_FILESIZE) failed: %s\n", cl_strerror(ret)); cl_engine_free(engine); @@ -755,7 +755,7 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi } #endif - if((opt = optget(opts, "MaxRecursion"))->enabled) { + if((opt = optget(opts, "MaxRecursion"))->active) { if((ret = cl_engine_set_num(engine, CL_ENGINE_MAX_RECURSION, opt->numarg))) { logg("!cl_engine_set_num(CL_ENGINE_MAX_RECURSION) failed: %s\n", cl_strerror(ret)); cl_engine_free(engine); @@ -768,7 +768,7 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi else logg("^Limits: Recursion level limit protection disabled.\n"); - if((opt = optget(opts, "MaxFiles"))->enabled) { + if((opt = optget(opts, "MaxFiles"))->active) { if((ret = cl_engine_set_num(engine, CL_ENGINE_MAX_FILES, opt->numarg))) { logg("!cl_engine_set_num(CL_ENGINE_MAX_FILES) failed: %s\n", cl_strerror(ret)); cl_engine_free(engine);