diff options
author | Matteo Bernardini <ponce@slackbuilds.org> | 2023-02-06 15:05:10 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-02-11 09:30:47 +0700 |
commit | 4fd61f2666642690e3ca6289e50e901f413748b7 (patch) | |
tree | 4a27de29dcfc5a576a828ef497ba7b5904fd4835 /network/havp | |
parent | cabbb4adcd1882514cff0231d2aee4fd4708d0f0 (diff) |
network/havp: Patch for clamav >= 1.0.x.
Thanks to Andrew Clemons for pointing at the patch!
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/havp')
-rw-r--r-- | network/havp/havp.SlackBuild | 2 | ||||
-rw-r--r-- | network/havp/patches/patch-havp_scanners_clamlibscanner_cpp | 64 |
2 files changed, 66 insertions, 0 deletions
diff --git a/network/havp/havp.SlackBuild b/network/havp/havp.SlackBuild index d4376a8a77209..d4480368c01b6 100644 --- a/network/havp/havp.SlackBuild +++ b/network/havp/havp.SlackBuild @@ -81,6 +81,8 @@ patch -p1 < $CWD/patches/fixup_and_install_init_script.diff patch -p1 < $CWD/patches/use_clamav_group_by_default.diff patch -p1 < $CWD/patches/put_templates_in_usrshare.diff +patch -p0 < $CWD/patches/patch-havp_scanners_clamlibscanner_cpp + CFLAGS="$SLKCFLAGS" ./configure \ --prefix=/usr \ diff --git a/network/havp/patches/patch-havp_scanners_clamlibscanner_cpp b/network/havp/patches/patch-havp_scanners_clamlibscanner_cpp new file mode 100644 index 0000000000000..fb6b1174c5a47 --- /dev/null +++ b/network/havp/patches/patch-havp_scanners_clamlibscanner_cpp @@ -0,0 +1,64 @@ +# clamav 1.0.0 mostly uses cl_error_t (aka unsigned int) for +# returning error values, change type to match +# +# ...except cl_statchkdir, which returns cl_error_t type values +# but is still an int, so bodge around that + +Index: havp/scanners/clamlibscanner.cpp +--- havp/scanners/clamlibscanner.cpp.orig ++++ havp/scanners/clamlibscanner.cpp +@@ -22,7 +22,7 @@ extern int LL; + bool ClamLibScanner::InitDatabase() + { + unsigned int sigs = 0; +- int ret; ++ cl_error_t ret; + if (LL>2) cl_debug(); + + #ifdef CL_INIT_DEFAULT +@@ -118,9 +118,10 @@ bool ClamLibScanner::InitDatabase() + + int ClamLibScanner::ReloadDatabase() + { +- int ret = cl_statchkdir(&dbstat); ++ cl_error_t ret; ++ int reti = cl_statchkdir(&dbstat); + +- if ( ret == 1 ) ++ if ( reti == 1 ) + { + unsigned int sigs = 0; + struct cl_settings *settings = NULL; +@@ -191,9 +192,9 @@ int ClamLibScanner::ReloadDatabase() + + return 1; + } +- else if ( ret != 0 ) ++ else if ( reti != 0 ) + { +- LogFile::ErrorMessage("ClamAV: Error on database check: %s\n", cl_strerror(ret)); ++ LogFile::ErrorMessage("ClamAV: Error on database check\n"); + } + + return 0; +@@ -203,9 +204,9 @@ int ClamLibScanner::ReloadDatabase() + string ClamLibScanner::Scan( const char *FileName ) + { + #ifdef CL_INIT_DEFAULT +- int ret = cl_scanfile(FileName, &virname, NULL, engine, &cl_options); ++ cl_error_t ret = cl_scanfile(FileName, &virname, NULL, engine, &cl_options); + #else +- int ret = cl_scanfile(FileName, &virname, NULL, engine, &limits, scanopts); ++ cl_error_t ret = cl_scanfile(FileName, &virname, NULL, engine, &limits, scanopts); + #endif + + //Clean? +@@ -240,7 +241,7 @@ string ClamLibScanner::Scan( const char *FileName ) + void ClamLibScanner::FreeDatabase() + { + #ifdef CL_INIT_DEFAULT +- int ret = cl_engine_free(engine); ++ cl_error_t ret = cl_engine_free(engine); + if ( ret != CL_SUCCESS ) + { + LogFile::ErrorMessage("ClamAV: cl_engine_free() failed: %s\n", cl_strerror(ret)); |