diff --git a/clamav-0.100.0-stats-deprecation.patch b/clamav-0.100.0-stats-deprecation.patch deleted file mode 100644 index 3ba6aa7b0888894cf0163394139d5ca8e46d1aef..0000000000000000000000000000000000000000 --- a/clamav-0.100.0-stats-deprecation.patch +++ /dev/null @@ -1,18 +0,0 @@ -https://bugzilla.clamav.net/show_bug.cgi?id=12097 - ---- a/shared/optparser.c -+++ b/shared/optparser.c -@@ -505,6 +505,13 @@ const struct clam_option __clam_options[ - { "ClamukoExcludeUID", NULL, 0, CLOPT_TYPE_NUMBER, MATCH_NUMBER, -1, NULL, FLAG_MULTIPLE, OPT_CLAMD | OPT_DEPRECATED, "", "" }, - { "ClamukoMaxFileSize", NULL, 0, CLOPT_TYPE_SIZE, MATCH_SIZE, 5242880, NULL, 0, OPT_CLAMD | OPT_DEPRECATED, "", "" }, - { "AllowSupplementaryGroups", NULL, 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_MILTER | OPT_DEPRECATED, "Initialize a supplementary group access (the process must be started by root).", "no" }, -+ { "StatsHostID", "stats-host-id", 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM | OPT_CLAMD | OPT_CLAMSCAN | OPT_DEPRECATED, "", "" }, -+ { "StatsEnabled", "enable-stats", 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_CLAMSCAN | OPT_DEPRECATED, "", "" }, -+ { "StatsPEDisabled", "disable-pe-stats", 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_CLAMSCAN | OPT_DEPRECATED, "", "" }, -+ { "StatsTimeout", "stats-timeout", 0, CLOPT_TYPE_NUMBER, MATCH_NUMBER, -1, NULL, 0, OPT_CLAMD | OPT_CLAMSCAN | OPT_FRESHCLAM | OPT_DEPRECATED, "", "" }, -+ { "SubmitDetectionStats", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM | OPT_DEPRECATED, "", "" }, -+ { "DetectionStatsCountry", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM | OPT_DEPRECATED, "", "" }, -+ { "DetectionStatsHostID", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM | OPT_DEPRECATED, "", "" }, - - /* Milter specific options */ - diff --git a/clamav-0.100.0-umask.patch b/clamav-0.100.0-umask.patch deleted file mode 100644 index 0e7c6ec2065e525a4a6ef8593910a514c8f27f84..0000000000000000000000000000000000000000 --- a/clamav-0.100.0-umask.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- clamav-0.100.0/clamav-milter/clamav-milter.c 2018-04-04 02:13:58.000000000 +0200 -+++ clamav-0.100.0/clamav-milter/clamav-milter.c.umask 2018-05-28 23:25:12.374047156 +0200 -@@ -432,7 +432,7 @@ - - if((opt = optget(opts, "PidFile"))->enabled) { - FILE *fd; -- mode_t old_umask = umask(0002); -+ mode_t old_umask = umask(0022); - - if((fd = fopen(opt->strarg, "w")) == NULL) { - logg("!Can't save PID in file %s\n", opt->strarg); ---- clamav-0.100.0/shared/output.c 2018-04-04 02:13:58.000000000 +0200 -+++ clamav-0.100.0/shared/output.c.umask 2018-05-28 23:24:41.968851516 +0200 -@@ -379,7 +379,7 @@ - - if (!logg_fp && logg_file) - { -- old_umask = umask(0037); -+ old_umask = umask(0077); - if ((logg_fp = fopen(logg_file, "at")) == NULL) - { - umask(old_umask); ---- clamav-0.100.0/freshclam/freshclam.c 2018-04-04 02:13:58.000000000 +0200 -+++ clamav-0.100.0/freshclam/freshclam.c.umask 2018-05-28 23:25:30.675164850 +0200 -@@ -127,7 +127,7 @@ - { - FILE *fd; - int old_umask; -- old_umask = umask (0006); -+ old_umask = umask (0022); - if ((fd = fopen (pidfile, "w")) == NULL) - { - logg ("!Can't save PID to file %s: %s\n", pidfile, strerror (errno)); diff --git a/clamav-0.101.4.tar.gz b/clamav-0.103.2.tar.gz similarity index 50% rename from clamav-0.101.4.tar.gz rename to clamav-0.103.2.tar.gz index 1c1cec2be5f81f45ae5a056bc7689382ecc8f934..5e4e2c1f69a4576b2a7ec2faff835de62933922e 100644 Binary files a/clamav-0.101.4.tar.gz and b/clamav-0.103.2.tar.gz differ diff --git a/clamav-check.patch b/clamav-check.patch new file mode 100644 index 0000000000000000000000000000000000000000..e3d37a4d3ee89abf167f06aa74eca5aa8b497d7a --- /dev/null +++ b/clamav-check.patch @@ -0,0 +1,12 @@ +diff -up clamav-0.103.0/unit_tests/check_jsnorm.c.check clamav-0.103.0/unit_tests/check_jsnorm.c +--- clamav-0.103.0/unit_tests/check_jsnorm.c.check 2020-09-12 18:27:10.000000000 -0600 ++++ clamav-0.103.0/unit_tests/check_jsnorm.c 2020-09-17 22:15:26.199957518 -0600 +@@ -247,7 +247,7 @@ static void tokenizer_test(const char *i + fd = open(filename, O_RDONLY); + if (fd < 0) { + jstest_teardown(); +- ck_assert_msg("failed to open output file: %s", filename); ++ ck_assert_msg(0, "failed to open output file: %s", filename); + } + + diff_file_mem(fd, expected, len); diff --git a/clamav-clamonacc-service.patch b/clamav-clamonacc-service.patch new file mode 100644 index 0000000000000000000000000000000000000000..bdac52d9150e211e1956dfd5e7b9c1c561f7c4fe --- /dev/null +++ b/clamav-clamonacc-service.patch @@ -0,0 +1,20 @@ +diff -up clamav-0.103.0/clamonacc/clamav-clamonacc.service.in.clamonacc-service clamav-0.103.0/clamonacc/clamav-clamonacc.service.in +--- clamav-0.103.0/clamonacc/clamav-clamonacc.service.in.clamonacc-service 2020-09-12 18:27:09.000000000 -0600 ++++ clamav-0.103.0/clamonacc/clamav-clamonacc.service.in 2020-09-18 19:49:35.400152760 -0600 +@@ -4,14 +4,12 @@ + [Unit] + Description=ClamAV On-Access Scanner + Documentation=man:clamonacc(8) man:clamd.conf(5) https://www.clamav.net/documents +-Requires=clamav-daemon.service +-After=clamav-daemon.service syslog.target network.target ++After=clamd@scan.service syslog.target network.target + + [Service] + Type=simple + User=root +-ExecStartPre=/bin/bash -c "while [ ! -S /run/clamav/clamd.ctl ]; do sleep 1; done" +-ExecStart=@prefix@/sbin/clamonacc -F --config-file=@APP_CONFIG_DIRECTORY@/clamd.conf --log=/var/log/clamav/clamonacc.log --move=/root/quarantine ++ExecStart=@prefix@/sbin/clamonacc -F --config-file=/etc/clamd.d/scan.conf + + [Install] + WantedBy=multi-user.target diff --git a/clamav-0.100.1-defaults_locations.patch b/clamav-default_confs.patch similarity index 51% rename from clamav-0.100.1-defaults_locations.patch rename to clamav-default_confs.patch index 5bcfa2d30d596eccbadecda3b40c469624ee6b30..97bbc1028d465bec76d40766f8f6b63828c58d1b 100644 --- a/clamav-0.100.1-defaults_locations.patch +++ b/clamav-default_confs.patch @@ -1,35 +1,23 @@ ---- ./clamconf/clamconf.c.orig 2018-07-30 05:28:40.199759145 +0100 -+++ ./clamconf/clamconf.c 2018-07-30 05:30:12.083760295 +0100 -@@ -58,9 +58,9 @@ static struct _cfgfile { +diff -up clamav-0.103.0/clamconf/clamconf.c.default_confs clamav-0.103.0/clamconf/clamconf.c +--- clamav-0.103.0/clamconf/clamconf.c.default_confs 2020-09-12 18:27:09.000000000 -0600 ++++ clamav-0.103.0/clamconf/clamconf.c 2020-09-17 22:00:20.792879792 -0600 +@@ -63,9 +63,9 @@ static struct _cfgfile { const char *name; int tool; } cfgfile[] = { -- { "clamd.conf", OPT_CLAMD }, -+ { "clamd.d/scan.conf", OPT_CLAMD }, - { "freshclam.conf", OPT_FRESHCLAM }, -- { "clamav-milter.conf", OPT_MILTER }, -+ { "mail/clamav-milter.conf", OPT_MILTER }, - { NULL, 0 } - }; +- {"clamd.conf", OPT_CLAMD}, ++ {"clamd.d/scan.conf", OPT_CLAMD}, + {"freshclam.conf", OPT_FRESHCLAM}, +- {"clamav-milter.conf", OPT_MILTER}, ++ {"mail/clamav-milter.conf", OPT_MILTER}, + {NULL, 0}}; ---- ./platform.h.in.orig 2018-07-30 06:27:54.437257754 +0100 -+++ ./platform.h.in 2018-07-30 06:29:18.920124404 +0100 -@@ -34,9 +34,9 @@ typedef unsigned int in_addr_t; - #define PATHSEP "/" - #endif - --#define CONFDIR_CLAMD CONFDIR PATHSEP "clamd.conf" -+#define CONFDIR_CLAMD CONFDIR PATHSEP "clamd.d/scan.conf" - #define CONFDIR_FRESHCLAM CONFDIR PATHSEP "freshclam.conf" --#define CONFDIR_MILTER CONFDIR PATHSEP "clamav-milter.conf" -+#define CONFDIR_MILTER CONFDIR PATHSEP "mail/clamav-milter.conf" - - #define cli_to_utf8_maybe_alloc(x) (x) - #define cli_strdup_to_utf8(x) strdup(x) ---- ./docs/man/clamav-milter.conf.5.in.orig 2018-07-31 02:47:52.768212114 +0100 -+++ ./docs/man/clamav-milter.conf.5.in 2018-07-31 02:48:57.295032444 +0100 -@@ -239,7 +239,7 @@ Default: no - All options expressing a size are limited to max 4GB. Values in excess will be reset to the maximum. + static void printopts(struct optstruct *opts, int nondef) +diff -up clamav-0.103.0/docs/man/clamav-milter.8.in.default_confs clamav-0.103.0/docs/man/clamav-milter.8.in +--- clamav-0.103.0/docs/man/clamav-milter.8.in.default_confs 2020-09-12 18:27:09.000000000 -0600 ++++ clamav-0.103.0/docs/man/clamav-milter.8.in 2020-09-17 22:00:20.793879800 -0600 +@@ -27,7 +27,7 @@ Print the version number and exit. + Read configuration from FILE. .SH "FILES" .LP -@CFGDIR@/clamav-milter.conf @@ -37,10 +25,11 @@ .SH "AUTHOR" .LP aCaB ---- ./docs/man/clamav-milter.8.in.orig 2018-07-31 02:47:45.154130364 +0100 -+++ ./docs/man/clamav-milter.8.in 2018-07-31 02:48:39.484792893 +0100 -@@ -27,7 +27,7 @@ Print the version number and exit. - Read configuration from FILE. +diff -up clamav-0.103.0/docs/man/clamav-milter.conf.5.in.default_confs clamav-0.103.0/docs/man/clamav-milter.conf.5.in +--- clamav-0.103.0/docs/man/clamav-milter.conf.5.in.default_confs 2020-09-12 18:27:09.000000000 -0600 ++++ clamav-0.103.0/docs/man/clamav-milter.conf.5.in 2020-09-17 22:00:20.794879808 -0600 +@@ -239,7 +239,7 @@ Default: no + All options expressing a size are limited to max 4GB. Values in excess will be reset to the maximum. .SH "FILES" .LP -@CFGDIR@/clamav-milter.conf @@ -48,19 +37,9 @@ .SH "AUTHOR" .LP aCaB ---- ./docs/man/clamd.conf.5.in.orig 2018-07-31 02:52:12.607659460 +0100 -+++ ./docs/man/clamd.conf.5.in 2018-07-31 02:52:37.396992885 +0100 -@@ -703,7 +703,7 @@ Default: no - All options expressing a size are limited to max 4GB. Values in excess will be reset to the maximum. - .SH "FILES" - .LP --@CFGDIR@/clamd.conf -+@CFGDIR@/clamd.d/scan.conf - .SH "AUTHORS" - .LP - Tomasz Kojm , Kevin Lin ---- ./docs/man/clamd.8.in.orig 2018-07-31 02:51:22.897990849 +0100 -+++ ./docs/man/clamd.8.in 2018-07-31 02:53:22.170595103 +0100 +diff -up clamav-0.103.0/docs/man/clamd.8.in.default_confs clamav-0.103.0/docs/man/clamd.8.in +--- clamav-0.103.0/docs/man/clamd.8.in.default_confs 2020-09-12 18:27:09.000000000 -0600 ++++ clamav-0.103.0/docs/man/clamd.8.in 2020-09-17 22:00:20.794879808 -0600 @@ -7,7 +7,7 @@ clamd \- an anti\-virus daemon clamd [options] .SH "DESCRIPTION" @@ -70,7 +49,7 @@ .SH "COMMANDS" .LP It's recommended to prefix clamd commands with the letter \fBz\fR (eg. zSCAN) to indicate that the command will be delimited by a NULL character and that clamd should continue reading command data until a NULL character is read. The null delimiter assures that the complete command and its entire argument will be processed as a single command. Alternatively commands may be prefixed with the letter \fBn\fR (e.g. nSCAN) to use a newline character as the delimiter. Clamd replies will honour the requested terminator in turn. -@@ -119,7 +119,7 @@ Reload the signature databases. +@@ -125,7 +125,7 @@ Reload the signature databases. Perform a clean exit. .SH "FILES" .LP @@ -79,3 +58,30 @@ .SH "CREDITS" Please check the full documentation for credits. .SH "AUTHOR" +diff -up clamav-0.103.0/docs/man/clamd.conf.5.in.default_confs clamav-0.103.0/docs/man/clamd.conf.5.in +--- clamav-0.103.0/docs/man/clamd.conf.5.in.default_confs 2020-09-17 22:00:20.795879816 -0600 ++++ clamav-0.103.0/docs/man/clamd.conf.5.in 2020-09-17 22:01:21.414353121 -0600 +@@ -759,7 +759,7 @@ Default: no + All options expressing a size are limited to max 4GB. Values in excess will be reset to the maximum. + .SH "FILES" + .LP +-@CFGDIR@/clamd.conf ++@CFGDIR@/clamd.d/scan.conf + .SH "AUTHORS" + .LP + Tomasz Kojm , Kevin Lin +diff -up clamav-0.103.0/platform.h.in.default_confs clamav-0.103.0/platform.h.in +--- clamav-0.103.0/platform.h.in.default_confs 2020-09-17 22:00:20.796879824 -0600 ++++ clamav-0.103.0/platform.h.in 2020-09-17 22:01:56.842629739 -0600 +@@ -112,9 +112,9 @@ typedef unsigned int in_addr_t; + #endif + + #ifndef _WIN32 +-#define CONFDIR_CLAMD CONFDIR PATHSEP "clamd.conf" ++#define CONFDIR_CLAMD CONFDIR PATHSEP "clamd.d/scan.conf" + #define CONFDIR_FRESHCLAM CONFDIR PATHSEP "freshclam.conf" +-#define CONFDIR_MILTER CONFDIR PATHSEP "clamav-milter.conf" ++#define CONFDIR_MILTER CONFDIR PATHSEP "mail/clamav-milter.conf" + #endif + + #ifndef WORDS_BIGENDIAN diff --git a/clamav-freshclam.service.patch b/clamav-freshclam.service.patch new file mode 100644 index 0000000000000000000000000000000000000000..c1ff9bc0922a1892c466263d8f0ad98b17386fac --- /dev/null +++ b/clamav-freshclam.service.patch @@ -0,0 +1,10 @@ +--- ./freshclam/clamav-freshclam.service.in.orig 2021-02-01 20:49:25.000000000 +0000 ++++ ./freshclam/clamav-freshclam.service.in 2021-03-07 22:59:34.476455890 +0000 +@@ -8,7 +8,6 @@ After=network-online.target + + [Service] + ExecStart=@prefix@/bin/freshclam -d --foreground=true +-StandardOutput=syslog + + [Install] + WantedBy=multi-user.target diff --git a/clamav-stats-deprecation.patch b/clamav-stats-deprecation.patch new file mode 100644 index 0000000000000000000000000000000000000000..a12f138e00ca19f43ef95dffbdbde374b1929e3a --- /dev/null +++ b/clamav-stats-deprecation.patch @@ -0,0 +1,17 @@ +diff -up clamav-0.102.0/shared/optparser.c.stats-deprecation clamav-0.102.0/shared/optparser.c +--- clamav-0.102.0/shared/optparser.c.stats-deprecation 2019-10-10 21:55:31.245995091 -0600 ++++ clamav-0.102.0/shared/optparser.c 2019-10-11 20:40:04.580067432 -0600 +@@ -524,6 +524,13 @@ const struct clam_option __clam_options[ + {"ArchiveLimitMemoryUsage", NULL, 0, CLOPT_TYPE_BOOL, MATCH_BOOL, -1, NULL, 0, OPT_CLAMD | OPT_DEPRECATED, "", ""}, + {"MailFollowURLs", "mail-follow-urls", 0, CLOPT_TYPE_BOOL, MATCH_BOOL, -1, NULL, 0, OPT_CLAMD | OPT_CLAMSCAN | OPT_DEPRECATED, "", ""}, + {"AllowSupplementaryGroups", NULL, 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_MILTER | OPT_DEPRECATED, "Initialize a supplementary group access (the process must be started by root).", "no"}, ++ {"StatsHostID", "stats-host-id", 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM | OPT_CLAMD | OPT_CLAMSCAN | OPT_DEPRECATED, "", "" }, ++ {"StatsEnabled", "enable-stats", 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_CLAMSCAN | OPT_DEPRECATED, "", ""}, ++ {"StatsPEDisabled", "disable-pe-stats", 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_CLAMSCAN | OPT_DEPRECATED, "", ""}, ++ {"StatsTimeout", "stats-timeout", 0, CLOPT_TYPE_NUMBER, MATCH_NUMBER, -1, NULL, 0, OPT_CLAMD | OPT_CLAMSCAN | OPT_FRESHCLAM | OPT_DEPRECATED, "", ""}, ++ {"SubmitDetectionStats", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM | OPT_DEPRECATED, "", ""}, ++ {"DetectionStatsCountry", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM | OPT_DEPRECATED, "", ""}, ++ {"DetectionStatsHostID", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM | OPT_DEPRECATED, "", ""}, + {"ScanOnAccess", NULL, 0, CLOPT_TYPE_BOOL, MATCH_BOOL, -1, NULL, 0, OPT_CLAMD | OPT_DEPRECATED, "", ""}, + + /* Milter specific options */ diff --git a/clamav.spec b/clamav.spec index d0ab7b9a19fad72e6cf435eec6626ecae2a07f88..b7294fcb866d9ad78b9f36e77fcc82d7b1838945 100644 --- a/clamav.spec +++ b/clamav.spec @@ -1,16 +1,15 @@ Name: clamav Summary: End-user tools for the Clam Antivirus scanner -Version: 0.101.4 -Release: 5 -License: GPLv2 +Version: 0.103.2 +Release: 1 +License: GPLv2 and Public Domain and bzip2-1.0.6 and Zlib and Apache-2.0 URL: https://www.clamav.net/ -Source0: https://www.clamav.net/downloads/production/clamav-%version.tar.gz +Source0: https://www.clamav.net/downloads/production/clamav-%{version}.tar.gz Source1: clamd.sysconfig Source2: clamd.logrotate Source3: main-58.cvd Source4: daily-25550.cvd Source5: bytecode-330.cvd -Source6: clamd-gen Source7: freshclam-sleep Source8: freshclam.sysconfig Source9: clamav-update.crond @@ -21,11 +20,12 @@ Source13: clamd.scan.upstart Source14: clamd@scan.service Source15: clamd@.service -Patch0001: clamav-0.100.0-stats-deprecation.patch -Patch0002: clamav-0.100.1-defaults_locations.patch +Patch0001: clamav-stats-deprecation.patch +Patch0002: clamav-default_confs.patch Patch0003: clamav-0.99-private.patch -Patch0004: clamav-0.100.0-umask.patch -Patch0005: llvm-glibc.patch +Patch0004: clamav-check.patch +Patch0005: clamav-clamonacc-service.patch +Patch0006: clamav-freshclam.service.patch BuildRequires: autoconf automake gettext-devel libtool libtool-ltdl-devel BuildRequires: gcc-c++ zlib-devel bzip2-devel gmp-devel curl-devel json-c-devel @@ -153,8 +153,8 @@ install -d libclamunrar{,_iface} touch libclamunrar/{Makefile.in,all,install} sed -ri -e 's!^#?(LogFile ).*!#\1/var/log/clamd.!g' \ - -e 's!^#?(LocalSocket ).*!#\1/var/run/clamd./clamd.sock!g' \ - -e 's!^(#?PidFile ).*!\1/var/run/clamd./clamd.pid!g' \ + -e 's!^#?(LocalSocket ).*!#\1%{_rundir}/clamd./clamd.sock!g' \ + -e 's!^(#?PidFile ).*!\1%{_rundir}/clamd./clamd.pid!g' \ -e 's!^#?(User ).*!\1!g' \ -e 's!^#?(AllowSupplementaryGroups|LogSyslog).*!\1 yes!g' \ -e 's! /usr/local/share/clamav,! %_var/lib/clamav,!g' etc/clamd.conf.sample @@ -215,7 +215,6 @@ install -D -m 0644 -p %SOURCE5 $RPM_BUILD_ROOT%_var/lib/clamav/bytecode.cvd install -D -m 0644 -p %SOURCE1 _doc_server/clamd.sysconfig install -D -m 0644 -p %SOURCE2 _doc_server/clamd.logrotate install -D -m 0644 -p etc/clamd.conf.sample _doc_server/clamd.conf -install -m 0755 -p %SOURCE6 $RPM_BUILD_ROOT%_datadir/%name/ install -D -p _doc_server/* $RPM_BUILD_ROOT%_datadir/%name/template install -D -p -m 0644 %SOURCE15 $RPM_BUILD_ROOT%_unitdir/clamd@.service install -D -m 0644 -p %SOURCE10 $RPM_BUILD_ROOT%_sysconfdir/logrotate.d/clamav-update @@ -237,7 +236,6 @@ sed -e 's!!scan!g;s!!clamscan!g' \ etc/clamd.conf.sample > $RPM_BUILD_ROOT%_sysconfdir/clamd.d/scan.conf install -D -p -m 0644 %SOURCE13 $RPM_BUILD_ROOT%_sysconfdir/init/clamd.scan.conf -install -D -p -m 0644 %SOURCE14 $RPM_BUILD_ROOT%_unitdir/clamd@scan.service cat << EOF > $RPM_BUILD_ROOT%_tmpfilesdir/clamd.scan.conf d %_rundir/clamd.scan 0710 clamscan virusgroup @@ -287,16 +285,15 @@ usermod clamscan -a -G virusgroup exit 0 %post -n clamd -%systemd_post clamd@.service +[ -L /etc/systemd/system/multi-user.target.wants/clamd@scan.service ] && + ln -sf /usr/lib/systemd/system/clamd@.service /etc/systemd/system/multi-user.target.wants/clamd@scan.service || : %systemd_post clamd@scan.service /bin/systemd-tmpfiles --create %_tmpfilesdir/clamd.scan.conf || : %preun -n clamd -%systemd_preun clamd@.service %systemd_preun clamd@scan.service %postun -n clamd -%systemd_postun_with_restart clamd@.service %systemd_postun_with_restart clamd@scan.service %post update @@ -348,11 +345,14 @@ test -e %_var/log/clamav-milter.log || { %_bindir/{clambc,clamconf,clamdscan,clamdtop,clamscan,clamsubmit,sigtool} %_libdir/libclamav.so.9* %_libdir/libclammspack.so.0* +%_sbindir/clamonacc +%_unitdir/clamav-clamonacc.service + %files devel %_includedir/* %_libdir/*.so -%_datadir/%name/{template,clamd-gen} +%_datadir/%name/template %_libdir/pkgconfig/* %_bindir/clamav-config @@ -360,6 +360,7 @@ test -e %_var/log/clamav-milter.log || { %_mandir/man[15]/* %_mandir/man8/clamd.8* %_mandir/man8/clamav-milter* +%_mandir/man8/clamonacc.8* %_mandir/*/freshclam* %files filesystem @@ -376,6 +377,7 @@ test -e %_var/log/clamav-milter.log || { %files update %_bindir/freshclam +%_libdir/libfreshclam.so.2* %_datadir/%name/freshclam-sleep %config(noreplace) %verify(not mtime) %_sysconfdir/freshclam.conf %config(noreplace) %verify(not mtime) %_sysconfdir/logrotate.d/* @@ -388,7 +390,7 @@ test -e %_var/log/clamav-milter.log || { %files -n clamd %doc _doc_server/* %_sbindir/clamd -%_unitdir/clamd@{scan,}.service +%_unitdir/clamd@.service %config(noreplace) %_sysconfdir/clamd.d/scan.conf %ghost %_rundir/clamd.scan/clamd.sock @@ -408,6 +410,18 @@ test -e %_var/log/clamav-milter.log || { %changelog +* Fri Apr 16 2021 wangyue - 0.103.2-1 +- Upgrade to 0.103.2-1 + +* Thu Feb 18 2021 zhanghua - 0.101.4-8 +- fix CVE-2019-15961 + +* Fri Oct 09 2020 lingsheng - 0.101.4-7 +- Fix int64 overflow check + +* Tue Sep 21 2020 chengzihan - 0.101.4-6 +- Drop clamd@scann.service file, change /var/run to /run + * Thu Mar 12 2020 wutao - 0.101.4-5 - Type:N/A - ID:N/A diff --git a/clamav.yaml b/clamav.yaml new file mode 100644 index 0000000000000000000000000000000000000000..06cb95252ae55c760964eb050998e59541fa3bcb --- /dev/null +++ b/clamav.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: Cisco-Talos/clamav-devel +tag_prefix: clamav- +seperator: . diff --git a/clamd-gen b/clamd-gen deleted file mode 100755 index ac5dae27226b1bf75adc0d391cf44e1dbab2fdac..0000000000000000000000000000000000000000 --- a/clamd-gen +++ /dev/null @@ -1,269 +0,0 @@ -#! /bin/bash - -# Copyright (C) 2004 Enrico Scholz -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -function showHelp() -{ - echo \ -$"Usage: clamd-gen --service= --version= --release= - --license= --username=>USERNAME> -" - exit 0 -} - -function rpm.generatePreamble() -{ - cat < sysv -Requires: clamav-server-sysv -Requires(post): %name = %epoch:%version-%release -Requires(post): diffutils mktemp %__chkconfig -Requires(preun): %__chkconfig -Requires(pre): %_initrddir -Requires(postun): %_initrddir - -%package minit -Summary: minit initscripts for a %service clamav-server -Group: System Environment/Daemons -Provides: init(%name) = minit -Conflicts: init(%name) < minit -Conflicts: init(%name) > minit -Requires(post): %name = %epoch:%version-%release -Requires(post): diffutils mktemp -Requires(pre): minit-setup -Requires(postun): minit-setup -Requires(triggers): minit-tools - - -%description -Basic setup for a clamav server for '%service'. - - -%description sysv -Basic setup for a clamav server for '%service'. - -This package contains initscripts for SysV based systems. - - -%description minit -Basic setup for a clamav server for '%service'. - -This package contains initscripts for minit based systems. - -EOF -} - - -function rpm.genBody() -{ - cat <<"XEOFX" -%prep -%build - -%install -rm -rf $RPM_BUILD_ROOT -%__install -d -m755 $RPM_BUILD_ROOT{%minitsvcdir,%_sbindir,%rundir,/var/log} - -d=/usr/share/clamav/template - -function subst -{ - src=$d/$1 - dst=$RPM_BUILD_ROOT$2 - - %__install -d -m755 $(dirname "$dst") - sed -e 's!^\(#?LogFile \).*!\1%logfile!g; - s!^#?\(LocalSocket \).*!\1%rundir/clamd.sock!g; - s!^#?\(PidFile \).*!\1%rundir/clamd.pid!g; - s!!%service!g; - s!!%username!g;' "$src" >"$dst" - chmod --reference "$src" "$dst" -} - -subst clamd.conf %conffile -subst clamd.logrotate %_sysconfdir/logrotate.d/clamd.%service - -%if 0%{!?_without_sysv:1} -subst clamd.sysconfig %_sysconfdir/sysconfig/clamd.%service -subst clamd.init %_initrddir/clamd.%service -%endif - -ln -s clamd $RPM_BUILD_ROOT%_sbindir/clamd.%service - -touch $RPM_BUILD_ROOT%logfile -touch $RPM_BUILD_ROOT%rundir/clamd.sock - -%if 0%{!?_without_minit:1} -ln -s %_sbindir/clamd.%service $RPM_BUILD_ROOT%minitsvcdir/run -touch $RPM_BUILD_ROOT%minitsvcdir/respawn -cat <$RPM_BUILD_ROOT%minitsvcdir/params --c -%conffile -EOF -%endif - -%clean -rm -rf $RPM_BUILD_ROOT - - -%triggerin minit -- %baseservice -minit-svc add services/clamd.%service services/%baseservice/ - -%triggerun minit -- %baseservice -test "$1" != 0 -a "$2" != 0 || \ - minit-svc del services/clamd.%service services/%baseservice/ - - -%post minit -d=$(mktemp /tmp/clamd.%service.XXXXXX) -sed -e 's!^#Foreground!Foreground!' "%conffile" >"$d" -grep -q '^Foreground' $d || echo 'Foreground' >>$d -cmp -s "$d" %conffile || cat "$d" >"%conffile" -rm -f "$d" - -%post sysv -d=$(mktemp /tmp/clamd.%service.XXXXXX) -sed -e 's!^Foreground!#Foreground!' "%conffile" >"$d" -cmp -s "$d" %conffile || cat "$d" >"%conffile" -rm -f "$d" - -%__chkconfig --add %name - - -%preun sysv -test "$1" != 0 || %__chkconfig --del %name - -XEOFX -} - - -function rpm.genFiles -{ - cat <<"EOF" -%files -%defattr(-,root,root,-) -%doc -%config(noreplace) %verify(not size md5 mtime) %attr(0620,root,%username) %logfile -%config(noreplace) %verify(not mtime) %conffile -%config(noreplace) %verify(not mtime) %_sysconfdir/logrotate.d/clamd.%service -%_sbindir/clamd.%service -%dir %attr(0700,%username,root) %rundir -%ghost %rundir/clamd.sock - - -%if 0%{!?_without_sysv:1} -%files sysv -%defattr(-,root,root,-) -%config %verify(not mtime) %_initrddir/clamd.%service -%config(noreplace) %verify(not mtime) %_sysconfdir/sysconfig/clamd.%service -%endif - - -%if 0%{!?_without_minit:1} -%files minit -%defattr(-,root,root,-) -%dir %minitsvcdir -%config(noreplace) %verify(not mtime) %minitsvcdir/params -%config %minitsvcdir/run - %minitsvcdir/respawn -%endif -EOF -} - - -SERVICE= -VERSION= -RELEASE= -LICENSE= -USERNAME= -tmp=$(getopt -o '' --long service:,version:,release:,license:,username:,help -n "$0" -- "$@") || exit 1 -eval set -- "$tmp" - -while true; do - case "$1" in - (--help) showHelp $0;; - (--service) SERVICE=$2; shift;; - (--version) VERSION=$2; shift;; - (--release) RELEASE=$2; shift;; - (--license) LICENSE=$2; shift;; - (--username) USERNAME=$2; shift;; - (--) shift; break;; - esac - shift -done - -for i in SERVICE VERSION RELEASE LICENSE USERNAME; do - eval tmp=\$${i} - test "$tmp" || { - echo $"No value for $i specified; assuming @${i}@" >&2; - eval $i=@${i}@; - } -done - - -rpm.generatePreamble -rpm.generateHeader -rpm.genBody -rpm.genFiles diff --git a/clamd@.service b/clamd@.service index 4590ae45980e242480071b7e4e3c005c01e14254..952a93745589eb91aadcac1486391df6e6aa640b 100644 --- a/clamd@.service +++ b/clamd@.service @@ -1,12 +1,15 @@ [Unit] Description = clamd scanner (%i) daemon Documentation=man:clamd(8) man:clamd.conf(5) https://www.clamav.net/documents/ -# Check for database existence -# ConditionPathExistsGlob=@DBDIR@/main.{c[vl]d,inc} -# ConditionPathExistsGlob=@DBDIR@/daily.{c[vl]d,inc} After = syslog.target nss-lookup.target network.target [Service] Type = forking ExecStart = /usr/sbin/clamd -c /etc/clamd.d/%i.conf +# Reload the database +# ExecReload=/bin/kill -USR2 $MAINPID Restart = on-failure +TimeoutStartSec=420 + +[Install] +WantedBy = multi-user.target diff --git a/llvm-glibc.patch b/llvm-glibc.patch deleted file mode 100644 index 67dbdd7d8bc2938b1d68baadcc773f393108fdd9..0000000000000000000000000000000000000000 --- a/llvm-glibc.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: clamav-0.97.3/libclamav/c++/llvm/lib/ExecutionEngine/JIT/Intercept.cpp -=================================================================== ---- clamav-0.97.3.orig/libclamav/c++/llvm/lib/ExecutionEngine/JIT/Intercept.cpp -+++ clamav-0.97.3/libclamav/c++/llvm/lib/ExecutionEngine/JIT/Intercept.cpp -@@ -52,6 +52,7 @@ static void runAtExitHandlers() { - #include - #endif - #include -+#include - /* stat functions are redirecting to __xstat with a version number. On x86-64 - * linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat' - * available as an exported symbol, so we have to add it explicitly.