|
|
|
# ClamAV
|
|
|
|
|
GitHub Actions testing on Ubuntu, Mac, & Windows
Updates to fix issues in the CMake install instructions.
Updates the README.md to indicate that CMake is now preferred
Adds a GitHub Actions badge, Discord badge, and logo to the README.md.
CMake:
- Renamed ENABLE_DOCS to ENABLE_MAN_PAGES.
- Fixed build issue when milter isn't enabled on Linux. Changed the
default to build milter on non-macOS, non-Windows operating systems.
- Fix LD_LIBRARY_PATH for tests including on macOS where LD_LIBRARY_PATH
and DYLD_LIBRARY_PATH must be manually propagated to subprocesses.
- Use UNKNOWN IMPORTED library instead of INTERFACE IMPORTED library for
pdcurses, but still use INTERFACE IMPORTED for ncurses.
UNKNOWN IMPORTED appears to be required so that we can use
$<TARGET_FILE_DIR:Curses::curses> to collected the pdcurses library at
install time on Windows.
- When building with vcpkg on Windows, CMake will automatically install
your app local dependencies (aka the DLL runtime dependencies).
Meanwhile, file(GET_RUNTIME_DEPENDENCIES ...) doesn't appear to work
correctly with vcpkg packages. The solution is to use a custom target
that has CMake perform a local install to the unit_tests directory
when using vcpkg.
This is in fact far easier than using GET_RUNTIME_DEPENDENCIES in the
unit_tests for assembling the test environment but we can't use this
method for the non-vcpkg install because it won't collect
checkDynamic.dll for us because we don't install our tests.
We also can't link with the static check.lib because the static
check.lib has pthreads symbols linked in and will conflict with our
pthread.dll.
TL;DR: We'll continue to use file(GET_RUNTIME_DEPENDENCIES ...) for
assembling the test enviornment on non-vcpkg builds, and use the local
install method for vcpkg builds.
testcase.py: Wrapped a Pathlib.unlink() call in exception handling as
the missing_ok optional parameter requires a Python version too new for
common use.
Remove localtime_r from win32 compat lib.
localtime_r may be present in libcheck when building with vcpkg and
while making it a static function would also solve the issue, using
localtime_s instead like we do everywhere else should work just fine.
check_clamd: Limited the max # of connections for the stress test on Mac
to 850, to address issues found testing on macos-latest on GitHub Actions.
5 years ago
|
|
|
<p align="center">
|
|
|
|
<img width="250" height="250" src="https://raw.githubusercontent.com/Cisco-Talos/clamav/main/logo.png" alt='Maeve, the ClamAV mascot'>
|
GitHub Actions testing on Ubuntu, Mac, & Windows
Updates to fix issues in the CMake install instructions.
Updates the README.md to indicate that CMake is now preferred
Adds a GitHub Actions badge, Discord badge, and logo to the README.md.
CMake:
- Renamed ENABLE_DOCS to ENABLE_MAN_PAGES.
- Fixed build issue when milter isn't enabled on Linux. Changed the
default to build milter on non-macOS, non-Windows operating systems.
- Fix LD_LIBRARY_PATH for tests including on macOS where LD_LIBRARY_PATH
and DYLD_LIBRARY_PATH must be manually propagated to subprocesses.
- Use UNKNOWN IMPORTED library instead of INTERFACE IMPORTED library for
pdcurses, but still use INTERFACE IMPORTED for ncurses.
UNKNOWN IMPORTED appears to be required so that we can use
$<TARGET_FILE_DIR:Curses::curses> to collected the pdcurses library at
install time on Windows.
- When building with vcpkg on Windows, CMake will automatically install
your app local dependencies (aka the DLL runtime dependencies).
Meanwhile, file(GET_RUNTIME_DEPENDENCIES ...) doesn't appear to work
correctly with vcpkg packages. The solution is to use a custom target
that has CMake perform a local install to the unit_tests directory
when using vcpkg.
This is in fact far easier than using GET_RUNTIME_DEPENDENCIES in the
unit_tests for assembling the test environment but we can't use this
method for the non-vcpkg install because it won't collect
checkDynamic.dll for us because we don't install our tests.
We also can't link with the static check.lib because the static
check.lib has pthreads symbols linked in and will conflict with our
pthread.dll.
TL;DR: We'll continue to use file(GET_RUNTIME_DEPENDENCIES ...) for
assembling the test enviornment on non-vcpkg builds, and use the local
install method for vcpkg builds.
testcase.py: Wrapped a Pathlib.unlink() call in exception handling as
the missing_ok optional parameter requires a Python version too new for
common use.
Remove localtime_r from win32 compat lib.
localtime_r may be present in libcheck when building with vcpkg and
while making it a static function would also solve the issue, using
localtime_s instead like we do everywhere else should work just fine.
check_clamd: Limited the max # of connections for the stress test on Mac
to 850, to address issues found testing on macos-latest on GitHub Actions.
5 years ago
|
|
|
</p>
|
|
|
|
|
|
|
|
<p align="center">
|
|
|
|
ClamAV® is an open source antivirus engine for detecting trojans, viruses,
|
|
|
|
malware & other malicious threats.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p align="center">
|
|
|
|
<a href="https://github.com/Cisco-Talos/clamav/actions"><img src="https://github.com/Cisco-Talos/clamav/workflows/CMake%20Build/badge.svg" height="18"></a>
|
|
|
|
<a href="https://discord.gg/6vNAqWnVgw"><img src="https://img.shields.io/discord/636023333074370595.svg?logo=discord" height="18"/></a>
|
GitHub Actions testing on Ubuntu, Mac, & Windows
Updates to fix issues in the CMake install instructions.
Updates the README.md to indicate that CMake is now preferred
Adds a GitHub Actions badge, Discord badge, and logo to the README.md.
CMake:
- Renamed ENABLE_DOCS to ENABLE_MAN_PAGES.
- Fixed build issue when milter isn't enabled on Linux. Changed the
default to build milter on non-macOS, non-Windows operating systems.
- Fix LD_LIBRARY_PATH for tests including on macOS where LD_LIBRARY_PATH
and DYLD_LIBRARY_PATH must be manually propagated to subprocesses.
- Use UNKNOWN IMPORTED library instead of INTERFACE IMPORTED library for
pdcurses, but still use INTERFACE IMPORTED for ncurses.
UNKNOWN IMPORTED appears to be required so that we can use
$<TARGET_FILE_DIR:Curses::curses> to collected the pdcurses library at
install time on Windows.
- When building with vcpkg on Windows, CMake will automatically install
your app local dependencies (aka the DLL runtime dependencies).
Meanwhile, file(GET_RUNTIME_DEPENDENCIES ...) doesn't appear to work
correctly with vcpkg packages. The solution is to use a custom target
that has CMake perform a local install to the unit_tests directory
when using vcpkg.
This is in fact far easier than using GET_RUNTIME_DEPENDENCIES in the
unit_tests for assembling the test environment but we can't use this
method for the non-vcpkg install because it won't collect
checkDynamic.dll for us because we don't install our tests.
We also can't link with the static check.lib because the static
check.lib has pthreads symbols linked in and will conflict with our
pthread.dll.
TL;DR: We'll continue to use file(GET_RUNTIME_DEPENDENCIES ...) for
assembling the test enviornment on non-vcpkg builds, and use the local
install method for vcpkg builds.
testcase.py: Wrapped a Pathlib.unlink() call in exception handling as
the missing_ok optional parameter requires a Python version too new for
common use.
Remove localtime_r from win32 compat lib.
localtime_r may be present in libcheck when building with vcpkg and
while making it a static function would also solve the issue, using
localtime_s instead like we do everywhere else should work just fine.
check_clamd: Limited the max # of connections for the stress test on Mac
to 850, to address issues found testing on macos-latest on GitHub Actions.
5 years ago
|
|
|
<a href="https://twitter.com/clamav"><img src="https://abs.twimg.com/favicons/twitter.ico" width="18" height="18"></a>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
## Documentation & FAQ
|
|
|
|
|
|
|
|
ClamAV documentation is hosted at [docs.clamav.net](https://docs.clamav.net/).
|
|
|
|
The source archive for each release also includes a copy of the documentation
|
|
|
|
for [offline](docs/html/UserManual.html) reading.
|
|
|
|
|
|
|
|
You can contribute to the documentation by submitting improvements to
|
|
|
|
[Cisco-Talos/clamav-documentation](https://github.com/Cisco-Talos/clamav-documentation)
|
|
|
|
|
|
|
|
## ClamAV News
|
|
|
|
|
|
|
|
For information about the features in this and prior releases, read
|
|
|
|
[the news](NEWS.md).
|
|
|
|
|
|
|
|
Catch up on the latest about ClamAV by reading our
|
|
|
|
[blog](http://blog.clamav.net) and follow us on Twitter `@clamav`.
|
|
|
|
|
|
|
|
## ClamAV Signatures
|
|
|
|
|
|
|
|
Anyone can learn to read and write ClamAV signatures. To get started, see our
|
|
|
|
[signature writing manual](https://docs.clamav.net/manual/Signatures.html).
|
|
|
|
|
|
|
|
## Installation Instructions
|
|
|
|
|
|
|
|
### Using Docker
|
|
|
|
|
|
|
|
ClamAV can be run using Docker. For details, visit to the online manual under
|
|
|
|
["Docker"](https://docs.clamav.net/manual/Installing/Docker.html) and check out
|
|
|
|
our images on [Docker Hub](https://hub.docker.com/r/clamav/clamav).
|
|
|
|
|
|
|
|
### Using a Package Manager
|
|
|
|
|
|
|
|
For help installing from a package manager, refer to the online manual under
|
|
|
|
["Packages"](https://docs.clamav.net/manual/Installing/Packages.html).
|
|
|
|
|
|
|
|
### Using an Installer
|
|
|
|
|
|
|
|
The following install packages are available for download from
|
|
|
|
[clamav.net/downloads](https://www.clamav.net/downloads):
|
|
|
|
|
|
|
|
- Linux - Debian and RPM packages for x86_64 and i686. *New in v0.104.*
|
|
|
|
- macOS - PKG installer for x86_64 and arm64 (universal). *New in v0.104.*
|
|
|
|
- Windows - MSI installers and portable ZIP packages for win32 and x64.
|
Add CMake build tooling
This patch adds experimental-quality CMake build tooling.
The libmspack build required a modification to use "" instead of <> for
header #includes. This will hopefully be included in the libmspack
upstream project when adding CMake build tooling to libmspack.
Removed use of libltdl when using CMake.
Flex & Bison are now required to build.
If -DMAINTAINER_MODE, then GPERF is also required, though it currently
doesn't actually do anything. TODO!
I found that the autotools build system was generating the lexer output
but not actually compiling it, instead using previously generated (and
manually renamed) lexer c source. As a consequence, changes to the .l
and .y files weren't making it into the build. To resolve this, I
removed generated flex/bison files and fixed the tooling to use the
freshly generated files. Flex and bison are now required build tools.
On Windows, this adds a dependency on the winflexbison package,
which can be obtained using Chocolatey or may be manually installed.
CMake tooling only has partial support for building with external LLVM
library, and no support for the internal LLVM (to be removed in the
future). I.e. The CMake build currently only supports the bytecode
interpreter.
Many files used include paths relative to the top source directory or
relative to the current project, rather than relative to each build
target. Modern CMake support requires including internal dependency
headers the same way you would external dependency headers (albeit
with "" instead of <>). This meant correcting all header includes to
be relative to the build targets and not relative to the workspace.
For example, ...
```c
include "../libclamav/clamav.h"
include "clamd/clamd_others.h"
```
... becomes:
```c
// libclamav
include "clamav.h"
// clamd
include "clamd_others.h"
```
Fixes header name conflicts by renaming a few of the files.
Converted the "shared" code into a static library, which depends on
libclamav. The ironically named "shared" static library provides
features common to the ClamAV apps which are not required in
libclamav itself and are not intended for use by downstream projects.
This change was required for correct modern CMake practices but was
also required to use the automake "subdir-objects" option.
This eliminates warnings when running autoreconf which, in the next
version of autoconf & automake are likely to break the build.
libclamav used to build in multiple stages where an earlier stage is
a static library containing utils required by the "shared" code.
Linking clamdscan and clamdtop with this libclamav utils static lib
allowed these two apps to function without libclamav. While this is
nice in theory, the practical gains are minimal and it complicates
the build system. As such, the autotools and CMake tooling was
simplified for improved maintainability and this feature was thrown
out. clamdtop and clamdscan now require libclamav to function.
Removed the nopthreads version of the autotools
libclamav_internal_utils static library and added pthread linking to
a couple apps that may have issues building on some platforms without
it, with the intention of removing needless complexity from the
source. Kept the regular version of libclamav_internal_utils.la
though it is no longer used anywhere but in libclamav.
Added an experimental doxygen build option which attempts to build
clamav.h and libfreshclam doxygen html docs.
The CMake build tooling also may build the example program(s), which
isn't a feature in the Autotools build system.
Changed C standard to C90+ due to inline linking issues with socket.h
when linking libfreshclam.so on Linux.
Generate common.rc for win32.
Fix tabs/spaces in shared Makefile.am, and remove vestigial ifndef
from misc.c.
Add CMake files to the automake dist, so users can try the new
CMake tooling w/out having to build from a git clone.
clamonacc changes:
- Renamed FANOTIFY macro to HAVE_SYS_FANOTIFY_H to better match other
similar macros.
- Added a new clamav-clamonacc.service systemd unit file, based on
the work of ChadDevOps & Aaron Brighton.
- Added missing clamonacc man page.
Updates to clamdscan man page, add missing options.
Remove vestigial CL_NOLIBCLAMAV definitions (all apps now use
libclamav).
Rename Windows mspack.dll to libmspack.dll so all ClamAV-built
libraries have the lib-prefix with Visual Studio as with CMake.
5 years ago
|
|
|
|
|
|
|
To learn how to use these packages, refer to the online manual under
|
|
|
|
["Installing"](https://docs.clamav.net/manual/Installing.html#installing-with-an-installer).
|
|
|
|
|
|
|
|
### Build from Source
|
|
|
|
|
|
|
|
For step-by-step instructions, refer to the online manual:
|
|
|
|
- [Unix/Linux/Mac](https://docs.clamav.net/manual/Installing/Installing-from-source-Unix.html)
|
|
|
|
- [Windows](https://docs.clamav.net/manual/Installing/Installing-from-source-Windows.html)
|
|
|
|
|
|
|
|
The source archive for each release includes a copy of the documentation for
|
|
|
|
[offline](docs/html/UserManual.html) reading.
|
|
|
|
|
|
|
|
A reference with all of the available build options can be found in the
|
|
|
|
[INSTALL.md](INSTALL.md) file.
|
|
|
|
|
|
|
|
You can find additional advice for developers in the online manual under
|
|
|
|
["For Developers"](https://docs.clamav.net/manual/Development.html).
|
|
|
|
|
|
|
|
### Upgrading from a previous version
|
|
|
|
|
|
|
|
Visit [the FAQ](https://docs.clamav.net/faq/faq-upgrade.html) for tips on how
|
|
|
|
to upgrade from a previous version.
|
|
|
|
|
|
|
|
## Join the ClamAV Community
|
|
|
|
|
|
|
|
The best way to get in touch with the ClamAV community is to join our
|
|
|
|
[mailing lists](https://docs.clamav.net/faq/faq-ml.html).
|
|
|
|
|
|
|
|
You can also join the community on our
|
|
|
|
[ClamAV Discord chat server](https://discord.gg/6vNAqWnVgw).
|
|
|
|
|
|
|
|
## Want to make a contribution?
|
|
|
|
|
|
|
|
The ClamAV development team welcomes
|
|
|
|
[code contributions](https://github.com/Cisco-Talos/clamav),
|
|
|
|
improvements to
|
|
|
|
[our documentation](https://github.com/Cisco-Talos/clamav-documentation),
|
|
|
|
and also [bug reports](https://github.com/Cisco-Talos/clamav/issues).
|
|
|
|
|
|
|
|
Thanks for joining us!
|
|
|
|
|
|
|
|
## Licensing
|
|
|
|
|
|
|
|
ClamAV is licensed for public/open source use under the GNU General Public
|
|
|
|
License, Version 2 (GPLv2).
|
|
|
|
|
|
|
|
See `COPYING.txt` for a copy of the license.
|
|
|
|
|
|
|
|
### 3rd Party Code
|
|
|
|
|
|
|
|
ClamAV contains a number of components that include code copied in part or in
|
|
|
|
whole from 3rd party projects and whose code is not owned by Cisco and which
|
|
|
|
are licensed differently than ClamAV. These include:
|
|
|
|
|
|
|
|
- tomsfastmath: public domain
|
|
|
|
- Yara: Apache 2.0 license
|
|
|
|
- Yara has since switched to the BSD 3-Clause License;
|
|
|
|
Our source is out-of-date and needs to be updated.
|
|
|
|
- 7z / lzma: public domain
|
|
|
|
- libclamav's NSIS/NulSoft parser includes:
|
|
|
|
- zlib: permissive free software license
|
|
|
|
- bzip2 / libbzip2: BSD-like license
|
|
|
|
- OpenBSD's libc/regex: BSD license
|
|
|
|
- file: BSD license
|
|
|
|
- str.c: Contains BSD licensed modified-implementations of strtol(), stroul()
|
|
|
|
functions, Copyright (c) 1990 The Regents of the University of California.
|
|
|
|
- pngcheck (png.c): MIT/X11-style license
|
|
|
|
- getopt.c: MIT license
|
|
|
|
- Curl: license inspired by MIT/X, but not identical
|
|
|
|
- libmspack: LGPL license
|
|
|
|
- UnRAR (libclamunrar): a non-free/restricted open source license
|
|
|
|
- Note: The UnRAR license is incompatible with GPLv2 because it contains a
|
|
|
|
clause that prohibits reverse engineering a RAR compression algorithm from
|
|
|
|
the UnRAR decompression code.
|
|
|
|
For this reason, libclamunrar/libclamunrar_iface is not linked at all with
|
|
|
|
libclamav. It is instead loaded at run-time. If it fails to load, ClamAV
|
|
|
|
will continue running without RAR support.
|
|
|
|
|
|
|
|
See the `COPYING` directory for a copy of the 3rd party project licenses.
|
|
|
|
|
|
|
|
## Acknowledgements
|
|
|
|
|
|
|
|
Credit for contributions to each release can be found in the [News](NEWS.md).
|
|
|
|
|
|
|
|
ClamAV is brought to you by
|
|
|
|
[the ClamAV Team](https://www.clamav.net/about.html#credits)
|