Merge ~vpa1977/ubuntu/+source/clamav:merge-lp2018063 into ubuntu/+source/clamav:debian/sid

Proposed by Vladimir Petko
Status: Needs review
Proposed branch: ~vpa1977/ubuntu/+source/clamav:merge-lp2018063
Merge into: ubuntu/+source/clamav:debian/sid
Diff against target: 358 lines (+209/-54)
7 files modified
debian/changelog (+61/-0)
debian/clamav-base.postinst.in (+1/-1)
debian/clamav-freshclam-ifupdown (+104/-52)
debian/clamav-freshclam.links (+3/-0)
debian/control (+2/-1)
debian/patches/resolve-armhf-ftbfs.patch (+37/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Bryce Harrington (community) Needs Information
Dan Bungert (community) Needs Fixing
git-ubuntu import Pending
Review via email: mp+448163@code.launchpad.net

This proposal supersedes a proposal from 2023-07-30.

Description of the change

Changes:
  - Extend ifupdown script to support networkd-dispatcher.
     + d/clamav-freshclam-ifupdown: Modernize some parts of
       the script. Implement support for networkd-dispatcher.
     + d/clamav-freshclam.links: Install the
       clamav-freshclam-ifupdown script inside the proper
       /usr/lib/networkd-dispatcher/{off,routable}.d/
       directories.(LP: #1718227)
 - clamav-base.postinst.in: Quell warning from check for clamav user
   (LP: #1920217).

PPA: ppa:vpa1977/clamav [1]

Testing:
 - package upgrade/install/removal
 - autopkgtests
$autopkgtest -U -s -o logs --setup-commands="sudo add-apt-repository -y -u -s ppa:vpa1977/clamav" -B clamav -- qemu ~/.auto-img/autopkgtest-mantic-amd64.img

-----------------------
autopkgtest [14:26:36]: @@@@@@@@@@@@@@@@@@@@ summary
clamd PASS
client PASS
milter PASS
qemu-system-x86_64: terminating on signal 15 from pid 2604054 (/usr/bin/python3)
---------------------------

[1] https://launchpad.net/~vpa1977/+archive/ubuntu/clamav

To post a comment you must log in.
Revision history for this message
Vladimir Petko (vpa1977) wrote (last edit ): Posted in a previous version of this proposal
Download full text (4.0 KiB)

Package upgrade: (affected by [1])
-----------------
$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  gdisk gir1.2-javascriptcoregtk-4.0 gir1.2-soup-2.4 gir1.2-webkit2-4.0 libblockdev-crypto2 libblockdev-fs2
  libblockdev-loop2 libblockdev-part-err2 libblockdev-part2 libblockdev-swap2 libblockdev-utils2 libblockdev2
  libclamav9 libdmapsharing-3.0-2 libjavascriptcoregtk-4.0-18 liblc3-0 libparted-fs-resize0 libraw20
  libsoup-gnome2.4-1 libwebkit2gtk-4.0-37 linux-image-6.2.0-20-generic linux-modules-6.2.0-20-generic
  linux-modules-extra-6.2.0-20-generic python3-renderpm python3-reportlab-accel
Use 'sudo apt autoremove' to remove them.
#
# An OpenSSL vulnerability has recently been fixed with USN-6188-1 & 6119-1:
# CVE-2023-2650: possible DoS translating ASN.1 object identifiers.
# Ensure you have updated the package to its latest version.
#
The following packages will be upgraded:
  clamav clamav-base clamav-daemon clamav-freshclam clamav-milter clamdscan
6 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,908 kB of archives.
After this operation, 27.5 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 https://ppa.launchpadcontent.net/vpa1977/clamav/ubuntu mantic/main amd64 clamdscan amd64 1.0.1+dfsg-2ubuntu1~ppa1 [54.8 kB]
Get:2 https://ppa.launchpadcontent.net/vpa1977/clamav/ubuntu mantic/main amd64 clamav-daemon amd64 1.0.1+dfsg-2ubuntu1~ppa1 [217 kB]
Get:3 https://ppa.launchpadcontent.net/vpa1977/clamav/ubuntu mantic/main amd64 clamav-base all 1.0.1+dfsg-2ubuntu1~ppa1 [90.1 kB]
Get:4 https://ppa.launchpadcontent.net/vpa1977/clamav/ubuntu mantic/main amd64 clamav-freshclam amd64 1.0.1+dfsg-2ubuntu1~ppa1 [170 kB]
Get:5 https://ppa.launchpadcontent.net/vpa1977/clamav/ubuntu mantic/main amd64 clamav-milter amd64 1.0.1+dfsg-2ubuntu1~ppa1 [195 kB]
Get:6 https://ppa.launchpadcontent.net/vpa1977/clamav/ubuntu mantic/main amd64 clamav amd64 1.0.1+dfsg-2ubuntu1~ppa1 [6,182 kB]
Fetched 6,908 kB in 48s (144 kB/s)
Preconfiguring packages ...
(Reading database ... 242891 files and directories currently installed.)
Preparing to unpack .../0-clamdscan_1.0.1+dfsg-2ubuntu1~ppa1_amd64.deb ...
Unpacking clamdscan (1.0.1+dfsg-2ubuntu1~ppa1) over (0.103.8+dfsg-0ubuntu2) ...
Preparing to unpack .../1-clamav-daemon_1.0.1+dfsg-2ubuntu1~ppa1_amd64.deb ...
Unpacking clamav-daemon (1.0.1+dfsg-2ubuntu1~ppa1) over (0.103.8+dfsg-0ubuntu2) ...
Preparing to unpack .../2-clamav-base_1.0.1+dfsg-2ubuntu1~ppa1_all.deb ...
Unpacking clamav-base (1.0.1+dfsg-2ubuntu1~ppa1) over (0.103.8+dfsg-0ubuntu2) ...
Preparing to unpack .../3-clamav-freshclam_1.0.1+dfsg-2ubuntu1~ppa1_amd64.deb ...
Unpacking clamav-freshclam (1.0.1+dfsg-2ubuntu1~ppa1) over (0.103.8+dfsg-0ubuntu2) ...
Preparing to unpack .../4-clamav-milter_1.0.1+dfsg-2ubuntu1~ppa1_amd64.deb ...
Unpacking clamav-milter (1.0.1+dfsg-2ubuntu1~ppa1) over (0.103.8+dfsg-0ubuntu2) ...
Preparing to unpack .../5-clamav_1.0.1...

Read more...

Revision history for this message
Vladimir Petko (vpa1977) wrote : Posted in a previous version of this proposal
Download full text (5.1 KiB)

Package install:
------------------
$ sudo apt install clamav-daemon clamav-milter
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  clamav clamav-base clamav-freshclam clamdscan libclamav11 libmilter1.0.1 libmspack0 libtfm1
Suggested packages:
  libclamunrar clamav-docs daemon libclamunrar11
The following NEW packages will be installed:
  clamav clamav-base clamav-daemon clamav-freshclam clamav-milter clamdscan libclamav11 libmilter1.0.1 libmspack0
  libtfm1
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 13.9 MB of archives.
After this operation, 60.7 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://nz.archive.ubuntu.com/ubuntu mantic/main amd64 libmspack0 amd64 0.11-1 [39.3 kB]
Get:2 http://nz.archive.ubuntu.com/ubuntu mantic/main amd64 libtfm1 amd64 0.13.1-1 [85.2 kB]
Get:3 http://nz.archive.ubuntu.com/ubuntu mantic/universe amd64 libmilter1.0.1 amd64 8.17.2-1 [40.0 kB]
Get:4 https://ppa.launchpadcontent.net/vpa1977/clamav/ubuntu mantic/main amd64 clamav-base all 1.0.1+dfsg-2ubuntu1~ppa1 [90.1 kB]
Get:5 https://ppa.launchpadcontent.net/vpa1977/clamav/ubuntu mantic/main amd64 libclamav11 amd64 1.0.1+dfsg-2ubuntu1~ppa1 [6,864 kB]
Get:6 https://ppa.launchpadcontent.net/vpa1977/clamav/ubuntu mantic/main amd64 clamav-freshclam amd64 1.0.1+dfsg-2ubuntu1~ppa1 [170 kB]
Get:7 https://ppa.launchpadcontent.net/vpa1977/clamav/ubuntu mantic/main amd64 clamav-daemon amd64 1.0.1+dfsg-2ubuntu1~ppa1 [217 kB]
Get:8 https://ppa.launchpadcontent.net/vpa1977/clamav/ubuntu mantic/main amd64 clamav-milter amd64 1.0.1+dfsg-2ubuntu1~ppa1 [195 kB]
Get:9 https://ppa.launchpadcontent.net/vpa1977/clamav/ubuntu mantic/main amd64 clamav amd64 1.0.1+dfsg-2ubuntu1~ppa1 [6,182 kB]
Get:10 https://ppa.launchpadcontent.net/vpa1977/clamav/ubuntu mantic/main amd64 clamdscan amd64 1.0.1+dfsg-2ubuntu1~ppa1 [54.8 kB]
Fetched 13.9 MB in 1min 46s (132 kB/s)
Preconfiguring packages ...
Selecting previously unselected package clamav-base.
(Reading database ... 235067 files and directories currently installed.)
Preparing to unpack .../0-clamav-base_1.0.1+dfsg-2ubuntu1~ppa1_all.deb ...
Unpacking clamav-base (1.0.1+dfsg-2ubuntu1~ppa1) ...
Selecting previously unselected package libmspack0:amd64.
Preparing to unpack .../1-libmspack0_0.11-1_amd64.deb ...
Unpacking libmspack0:amd64 (0.11-1) ...
Selecting previously unselected package libtfm1:amd64.
Preparing to unpack .../2-libtfm1_0.13.1-1_amd64.deb ...
Unpacking libtfm1:amd64 (0.13.1-1) ...
Selecting previously unselected package libclamav11:amd64.
Preparing to unpack .../3-libclamav11_1.0.1+dfsg-2ubuntu1~ppa1_amd64.deb ...
Unpacking libclamav11:amd64 (1.0.1+dfsg-2ubuntu1~ppa1) ...
Selecting previously unselected package clamav-freshclam.
Preparing to unpack .../4-clamav-freshclam_1.0.1+dfsg-2ubuntu1~ppa1_amd64.deb ...
Unpacking clamav-freshclam (1.0.1+dfsg-2ubuntu1~ppa1) ...
Selecting previously unselected package clamav-daemon.
Preparing to unpack .../5-clamav-daemon_1.0.1+dfsg-2ubuntu1~ppa1_...

Read more...

Revision history for this message
Vladimir Petko (vpa1977) wrote : Posted in a previous version of this proposal

Package removal:
------------
$ sudo apt remove clamav-base
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libclamav11 libmilter1.0.1 libmspack0 libtfm1
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  clamav clamav-base clamav-daemon clamav-freshclam clamav-milter clamdscan
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
After this operation, 30.3 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 235205 files and directories currently installed.)
Removing clamav (1.0.1+dfsg-2ubuntu1~ppa1) ...
Removing clamav-daemon (1.0.1+dfsg-2ubuntu1~ppa1) ...
Removing clamdscan (1.0.1+dfsg-2ubuntu1~ppa1) ...
Removing clamav-milter (1.0.1+dfsg-2ubuntu1~ppa1) ...
Removing clamav-freshclam (1.0.1+dfsg-2ubuntu1~ppa1) ...
Removing clamav-base (1.0.1+dfsg-2ubuntu1~ppa1) ...
Processing triggers for man-db (2.11.2-3) ...

--------------

Revision history for this message
Dan Bungert (dbungert) wrote : Posted in a previous version of this proposal

This looks mostly fine, I have two requests:

* Please fix the author on "check password entry rather than id for clamav user", to help clarify the relation to previous work. `git commit --amend --author` mid-rebase should do the trick.
* minor trailing whitespace issue in changelog on line "/usr/lib/networkd-dispatcher/{off,routable}.d/"

Revision history for this message
Vladimir Petko (vpa1977) wrote : Posted in a previous version of this proposal

@dbungert, thank you!!!! Addressed.

Revision history for this message
Dan Bungert (dbungert) wrote :

In process of uploading, `git ubuntu prepare-upload` taking longer than expected.

review: Approve
Revision history for this message
Dan Bungert (dbungert) wrote :
654e04a... by Vladimir Petko

d/p/resolve-armhf-ftbfs.patch: resolve armhf failure to build from source

de762a4... by Vladimir Petko

changelog

Revision history for this message
Dan Bungert (dbungert) :
review: Needs Fixing
f0274a5... by Vladimir Petko

refresh patch as per review comments

Revision history for this message
Vladimir Petko (vpa1977) wrote :

retested after update:

autopkgtest -U -s -o logs --setup-commands="sudo add-apt-repository -y -u -s ppa:vpa1977/clamav" -B clamav -- qemu --ram-size 1520 ~/.auto-img/autopkgtest-mantic-amd64.img
---------------
autopkgtest [09:45:36]: @@@@@@@@@@@@@@@@@@@@ summary
clamd PASS
client PASS
milter PASS
qemu-system-x86_64: terminating on signal 15 from pid 3541133 (/usr/bin/python3)

---------------

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Vladimir, thanks for working on the ftbfs.

In the changelog entry (and commit message), can you include a brief explanation of what the failure was, and how it was fixed?

review: Needs Information
2fd0ea0... by Vladimir Petko

typo in the changelog entry

Revision history for this message
Bryce Harrington (bryce) wrote :

This MP can be marked "Merged".

It would probably be a good idea to forward this change to Debian and/or upstream.

Unmerged commits

2fd0ea0... by Vladimir Petko

typo in the changelog entry

f0274a5... by Vladimir Petko

refresh patch as per review comments

de762a4... by Vladimir Petko

changelog

654e04a... by Vladimir Petko

d/p/resolve-armhf-ftbfs.patch: resolve armhf failure to build from source

e0237a9... by Vladimir Petko

update maintainer

037b6c6... by Vladimir Petko

changelog: Merge of 1.0.1+dfsg-2

abaedea... by Vladimir Petko

Merge changelogs

86b393b... by Sergio Durigan Junior

  * Extend ifupdown script to support networkd-dispatcher.
    - d/clamav-freshclam-ifupdown: Modernize some parts of
      the script. Implement support for networkd-dispatcher.
    - d/clamav-freshclam.links: Install the
      clamav-freshclam-ifupdown script inside the proper
      /usr/lib/networkd-dispatcher/{off,routable}.d/
      directories.
    (LP: #1718227)

a9ef634... by Bryce Harrington

clamav-base.postinst.in: Quell warning from check for clamav user (LP: #1920217).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index d9d6c71..6eb715c 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,24 @@
6+clamav (1.0.1+dfsg-2ubuntu2) mantic; urgency=medium
7+
8+ * d/p/resolve-armhf-ftbfs.patch: resolve armhf failure to build from source.
9+
10+ -- Vladimir Petko <vladimir.petko@canonical.com> Wed, 02 Aug 2023 15:26:59 +1200
11+
12+clamav (1.0.1+dfsg-2ubuntu1) mantic; urgency=medium
13+
14+ * Merge with Debian unstable (LP: #2018063). Remaining changes:
15+ - Extend ifupdown script to support networkd-dispatcher.
16+ + d/clamav-freshclam-ifupdown: Modernize some parts of
17+ the script. Implement support for networkd-dispatcher.
18+ + d/clamav-freshclam.links: Install the
19+ clamav-freshclam-ifupdown script inside the proper
20+ /usr/lib/networkd-dispatcher/{off,routable}.d/
21+ directories.(LP: #1718227)
22+ - clamav-base.postinst.in: Quell warning from check for clamav user
23+ (LP: #1920217).
24+
25+ -- Vladimir Petko <vladimir.petko@canonical.com> Mon, 31 Jul 2023 09:11:40 +1200
26+
27 clamav (1.0.1+dfsg-2) unstable; urgency=medium
28
29 * Depend on latest libtfm1 (Closes: #1031896, #1027010).
30@@ -82,6 +103,39 @@ clamav (1.0.0+dfsg-1) experimental; urgency=medium
31
32 -- Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Sat, 31 Dec 2022 13:44:59 +0100
33
34+clamav (0.103.8+dfsg-0ubuntu2) mantic; urgency=medium
35+
36+ * Extend ifupdown script to support networkd-dispatcher.
37+ - d/clamav-freshclam-ifupdown: Modernize some parts of
38+ the script. Implement support for networkd-dispatcher.
39+ - d/clamav-freshclam.links: Install the
40+ clamav-freshclam-ifupdown script inside the proper
41+ /usr/lib/networkd-dispatcher/{off,routable}.d/
42+ directories.
43+ (LP: #1718227)
44+
45+ -- Sergio Durigan Junior <sergio.durigan@canonical.com> Fri, 12 May 2023 15:58:29 -0400
46+
47+clamav (0.103.8+dfsg-0ubuntu1) lunar; urgency=medium
48+
49+ * Updated to version 0.103.8 to fix security issues.
50+ - debian/rules: bump CL_FLEVEL to 129.
51+ - debian/libclamav9.symbols: updated CLAMAV_PRIVATE symbols to new
52+ version.
53+ - CVE-2023-20032, CVE-2023-20052
54+
55+ -- David Fernandez Gonzalez <david.fernandezgonzalez@canonical.com> Fri, 24 Feb 2023 09:27:20 +0100
56+
57+clamav (0.103.7+dfsg-1ubuntu1) lunar; urgency=medium
58+
59+ * Merge with Debian unstable (LP: #1993390). Remaining changes:
60+ - clamav-base.postinst.in: Quell warning from check for clamav user
61+ (LP #1920217)
62+ * Dropped:
63+ - Update translations
64+
65+ -- Bryce Harrington <bryce@canonical.com> Fri, 18 Nov 2022 23:35:15 -0800
66+
67 clamav (0.103.7+dfsg-1) unstable; urgency=medium
68
69 * Import 0.103.7
70@@ -89,6 +143,13 @@ clamav (0.103.7+dfsg-1) unstable; urgency=medium
71
72 -- Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Sun, 14 Aug 2022 21:33:51 +0200
73
74+clamav (0.103.6+dfsg-1ubuntu1) kinetic; urgency=medium
75+
76+ * clamav-base.postinst.in: Quell warning from check for clamav user
77+ (LP: #1920217)
78+
79+ -- Bryce Harrington <bryce@canonical.com> Wed, 18 May 2022 17:26:41 -0700
80+
81 clamav (0.103.6+dfsg-1) unstable; urgency=medium
82
83 * Import 0.103.6
84diff --git a/debian/clamav-base.postinst.in b/debian/clamav-base.postinst.in
85index 89c116f..f3d1da9 100644
86--- a/debian/clamav-base.postinst.in
87+++ b/debian/clamav-base.postinst.in
88@@ -32,7 +32,7 @@ case "$1" in
89
90 # Set up the clamav user on new install
91 if [ -z "$2" ]; then
92- if ! id clamav; then
93+ if ! getent passwd clamav >/dev/null; then
94 adduser --system --no-create-home --quiet \
95 --disabled-password --disabled-login \
96 --shell /bin/false --group --home /var/lib/clamav clamav
97diff --git a/debian/clamav-freshclam-ifupdown b/debian/clamav-freshclam-ifupdown
98index 875c0cc..232fd79 100755
99--- a/debian/clamav-freshclam-ifupdown
100+++ b/debian/clamav-freshclam-ifupdown
101@@ -1,16 +1,25 @@
102 #!/bin/sh
103 # 2004-01-25, Thomas Lamy <thomas.lamy@in-online.net>
104 # From Magnus Ekdahl's <magnus@debian.org> clamav-freshclam-handledaemon(8)
105+# Adjust to be networkd-dispatcher compatible by
106+# Sergio Durigan Junior <sergiodj@debian.org>
107
108 set -e
109
110-[ -e /var/lib/clamav/interface ] || exit 0
111+[ -f /var/lib/clamav/interface ] || exit 0
112+
113+if [ -d /run/systemd/system ]; then
114+ INIT='systemctl'
115+ INIT_SUFFIX='clamav-freshclam'
116+else
117+ INIT='invoke-rc.d clamav-freshclam'
118+ INIT_SUFFIX=''
119+fi
120
121-INIT=invoke-rc.d clamav-freshclam
122 CLAMAV_CONF_FILE=/etc/clamav/clamd.conf
123 FRESHCLAM_CONF_FILE=/etc/clamav/freshclam.conf
124
125-INTERNETIFACE=`cat /var/lib/clamav/interface`
126+INTERNETIFACE=$(cat /var/lib/clamav/interface)
127
128 if grep -q freshclam /proc/*/stat 2>/dev/null; then
129 IS_RUNNING=true
130@@ -18,61 +27,104 @@ else
131 IS_RUNNING=false
132 fi
133
134-# $IFACE is set by ifup/down, $PPP_IFACE by pppd
135-[ -n "$PPP_IFACE" ] && IFACE=$PPP_IFACE
136+handle_ifupdown ()
137+{
138+ # $IFACE is set by ifup/down, $PPP_IFACE by pppd
139+ [ -n "$PPP_IFACE" ] && IFACE=$PPP_IFACE
140
141-# This is sloppy - woody's pppd exports variables, while sid's passes them as
142-# arguments and exports them.
143+ # This is sloppy - woody's pppd exports variables, while sid's passes them as
144+ # arguments and exports them.
145
146-if [ "$1" = "$IFACE" ]; then # We're called by sid's pppd
147- shift 6 # and we already know the interface
148-fi # Dump the arguments passed.
149+ if [ "$1" = "$IFACE" ]; then # We're called by sid's pppd
150+ shift 6 # and we already know the interface
151+ fi # Dump the arguments passed.
152+
153+ if [ -z "$1" ]; then
154+ case $(dirname "$0") in
155+ */if-up.d|*/ip-up.d)
156+ # Short circuit and exit early if freshclam is already running
157+ [ "$IS_RUNNING" = 'true' ] && exit 0
158+ for interface in $INTERNETIFACE; do
159+ if [ "$interface" = "$IFACE" ]; then
160+ FMODE=start
161+ break
162+ else
163+ FMODE=skip
164+ fi
165+ done
166+ ;;
167+ */if-down.d|*/ip-down.d)
168+ # Short circuit and exit early if freshclam is not already running
169+ [ "$IS_RUNNING" = 'false' ] && exit 0
170+ for interface in $INTERNETIFACE; do
171+ if [ "$interface" = "$IFACE" ]; then
172+ FMODE=stop
173+ break
174+ else
175+ FMODE=skip
176+ fi
177+ done
178+ ;;
179+ *)
180+ FMODE=skip
181+ ;;
182+ esac
183+ else
184+ FMODE="$1"
185+ fi
186+
187+ case "$FMODE" in
188+ start|stop)
189+ IFACE="$IFACE" $INIT $FMODE $INIT_SUFFIX
190+ ;;
191+ skip)
192+ ;;
193+ *)
194+ echo "Usage: $0 {start|stop|skip}" >&2
195+ exit 1
196+ ;;
197+ esac
198+}
199+
200+handle_networkd_dispatcher ()
201+{
202+ FOUND_IFACE=false
203
204-if [ -z "$1" ]; then
205- case $(dirname "$0") in
206- */if-up.d|*/ip-up.d)
207- # Short circuit and exit early if freshclam is already running
208- [ "$IS_RUNNING" = 'true' ] && exit 0
209- for interface in $INTERNETIFACE; do
210- if [ "$interface" = "$IFACE" ]; then
211- FMODE=start
212- break
213- else
214- FMODE=skip
215- fi
216- done
217- ;;
218- */if-down.d|*/ip-down.d)
219- # Short circuit and exit early if freshclam is not already running
220- [ "$IS_RUNNING" = 'false' ] && exit 0
221 for interface in $INTERNETIFACE; do
222- if [ "$interface" = "$IFACE" ]; then
223- FMODE=stop
224- break
225- else
226- FMODE=skip
227- fi
228+ if [ "$interface" = "$IFACE" ]; then
229+ FOUND_IFACE=true
230+ break
231+ fi
232 done
233- ;;
234- *)
235- FMODE=skip
236- ;;
237- esac
238+
239+ [ "$FOUND_IFACE" = 'false' ] && return
240+
241+ FMODE=""
242+
243+ case "$STATE" in
244+ "off")
245+ if [ "$IS_RUNNING" = 'true' ]; then
246+ FMODE="stop"
247+ fi
248+ ;;
249+ "routable")
250+ if [ "$IS_RUNNING" = 'false' ]; then
251+ FMODE="start"
252+ fi
253+ ;;
254+ *)
255+ return
256+ esac
257+
258+ if [ -n "$FMODE" ]; then
259+ IFACE="$IFACE" $INIT $FMODE $INIT_SUFFIX
260+ fi
261+}
262+
263+if [ -n "$STATE" ]; then
264+ handle_networkd_dispatcher "$@"
265 else
266- FMODE="$1"
267+ handle_ifupdown "$@"
268 fi
269
270-case "$FMODE" in
271- start|stop)
272- IFACE="$IFACE" $INIT $FMODE
273- ;;
274- skip)
275- ;;
276- *)
277- echo "Usage: $0 {start|stop|skip}" >&2
278- exit 1
279- ;;
280-esac
281-
282 exit 0
283-
284diff --git a/debian/clamav-freshclam.links b/debian/clamav-freshclam.links
285index 78dfff6..3f0cfff 100644
286--- a/debian/clamav-freshclam.links
287+++ b/debian/clamav-freshclam.links
288@@ -1 +1,4 @@
289 /usr/share/doc/clamav-base/README.Debian.gz /usr/share/doc/clamav-freshclam/README.Debian.gz
290+/usr/share/doc/clamav-base/NEWS.gz /usr/share/doc/clamav-freshclam/NEWS.gz
291+/etc/network/if-up.d/clamav-freshclam-ifupdown /usr/lib/networkd-dispatcher/routable.d/clamav-freshclam
292+/etc/network/if-down.d/clamav-freshclam-ifupdown /usr/lib/networkd-dispatcher/off.d/clamav-freshclam
293diff --git a/debian/control b/debian/control
294index 3b2d0ff..c154edc 100644
295--- a/debian/control
296+++ b/debian/control
297@@ -1,7 +1,8 @@
298 Source: clamav
299 Section: utils
300 Priority: optional
301-Maintainer: ClamAV Team <pkg-clamav-devel@lists.alioth.debian.org>
302+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
303+XSBC-Original-Maintainer: ClamAV Team <pkg-clamav-devel@lists.alioth.debian.org>
304 Uploaders: Michael Meskes <meskes@debian.org>,
305 Michael Tautschnig <mt@debian.org>,
306 Scott Kitterman <scott@kitterman.com>,
307diff --git a/debian/patches/resolve-armhf-ftbfs.patch b/debian/patches/resolve-armhf-ftbfs.patch
308new file mode 100644
309index 0000000..ab3e0f4
310--- /dev/null
311+++ b/debian/patches/resolve-armhf-ftbfs.patch
312@@ -0,0 +1,37 @@
313+--- a/libclamav/special.c
314++++ b/libclamav/special.c
315+@@ -48,7 +48,8 @@
316+
317+ int cli_check_mydoom_log(cli_ctx *ctx)
318+ {
319+- const uint32_t *record;
320++ const uint32_t record[16];
321++ const uint32_t mask = 0xffffffff;
322+ uint32_t check, key;
323+ fmap_t *map = ctx->fmap;
324+ unsigned int blocks = map->len / (8 * 4);
325+@@ -59,14 +60,20 @@
326+ if (blocks > 5)
327+ blocks = 5;
328+
329+- record = fmap_need_off_once(map, 0, 8 * 4 * blocks);
330+- if (!record)
331++ // returns unaligned memory block
332++ const char* data = fmap_need_off_once(map, 0, 8 * 4 * blocks);
333++ if (!data)
334+ return CL_CLEAN;
335++
336+ while (blocks) { /* This wasn't probably intended but that's what the current code does anyway */
337+- if (record[--blocks] == 0xffffffff)
338++ unsigned int offset = --blocks;
339++ offset *=sizeof(uint32_t);
340++ // safe (but slow) on unaligned memory
341++ if (!memcmp(&data[offset], &mask, sizeof(uint32_t)))
342+ return CL_CLEAN;
343+ }
344+-
345++ // copy into aligned array to perform bit operations
346++ memcpy(record, data, sizeof(record));
347+ key = ~be32_to_host(record[0]);
348+ check = (be32_to_host(record[1]) ^ key) +
349+ (be32_to_host(record[2]) ^ key) +
350diff --git a/debian/patches/series b/debian/patches/series
351index 9d97992..76056eb 100644
352--- a/debian/patches/series
353+++ b/debian/patches/series
354@@ -7,3 +7,4 @@ libclamav-Add-missing-symbols.patch
355 Add-a-version-script-for-libclamav-and-libfreshclam.patch
356 libclamav-pe-Use-endian-wrapper-in-more-places.patch
357 Add-an-option-to-avoid-setting-RPATH-on-unix-systems.patch
358+resolve-armhf-ftbfs.patch

Subscribers

People subscribed via source and target branches