Jammy verification
==================

root@clamav-jammy-sru:~# lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy

root@clamav-jammy-sru:~# dpkg -l | grep clamav
ii  clamav                          1.5.3+dfsg-0ubuntu0.22.04.2                 
     amd64        anti-virus utility for Unix - command-line interface
ii  clamav-base                     1.5.3+dfsg-0ubuntu0.22.04.2                 
     all          anti-virus utility for Unix - base package
ii  clamav-daemon                   1.5.3+dfsg-0ubuntu0.22.04.2                 
     amd64        anti-virus utility for Unix - scanner daemon
ii  clamav-freshclam                1.5.3+dfsg-0ubuntu0.22.04.2                 
     amd64        anti-virus utility for Unix - virus database update utility
ii  libclamav12:amd64               1.5.3+dfsg-0ubuntu0.22.04.2                 
     amd64        anti-virus utility for Unix - library

Test Case #1
------------

dpkg-reconfigure and chose:
TCP, port 3330, IP: 10.108.97.11

root@clamav-jammy-sru:~# sudo systemctl restart clamav-daemon
root@clamav-jammy-sru:~# sudo ss -pln | grep 3330
root@clamav-jammy-sru:~# printf "PING\n" | nc 10.108.97.11 3330

root@clamav-jammy-sru:~# systemctl cat clamav-daemon.socket
# /lib/systemd/system/clamav-daemon.socket
[Unit]
...

[Socket]
ListenStream=/run/clamav/clamd.ctl
#ListenStream=1024
SocketUser=clamav
SocketGroup=clamav
RemoveOnStop=True

[Install]
WantedBy=sockets.target

Nothing is listening on the configured IP:port and changes are not
reflected in the socket file

Test Case #2
------------

root@clamav-jammy-sru:~# sudo dpkg-reconfigure clamav-daemon
# Set the socket to clamd-alt.ctl, socketgroup to clamav-user, socketmode to 777

root@clamav-jammy-sru:~# sudo systemctl restart clamav-daemon
root@clamav-jammy-sru:~# printf "PING\n" | socat - 
UNIX-CONNECT:/run/clamav/clamd-alt.ctl
2026/08/31 19:33:30 socat[4804] E connect(5, AF=1 "/run/clamav/clamd-alt.ctl", 
27): No such file or directory

root@clamav-jammy-sru:~# systemctl cat clamav-daemon.socket
# /lib/systemd/system/clamav-daemon.socket
[Unit]
...

[Socket]
ListenStream=/run/clamav/clamd.ctl
#ListenStream=1024
SocketUser=clamav
SocketGroup=clamav
RemoveOnStop=True

[Install]
WantedBy=sockets.target

Changes aren't reflected in the socket file and nothing is listening

Proposed
--------

root@clamav-jammy-sru:~# dpkg -l | grep clamav
ii  clamav                          1.5.3+dfsg-0ubuntu0.22.04.3                 
     amd64        anti-virus utility for Unix - command-line interface
ii  clamav-base                     1.5.3+dfsg-0ubuntu0.22.04.3                 
     all          anti-virus utility for Unix - base package
ii  clamav-daemon                   1.5.3+dfsg-0ubuntu0.22.04.3                 
     amd64        anti-virus utility for Unix - scanner daemon
ii  clamav-freshclam                1.5.3+dfsg-0ubuntu0.22.04.3                 
     amd64        anti-virus utility for Unix - virus database update utility
ii  libclamav12:amd64               1.5.3+dfsg-0ubuntu0.22.04.3                 
     amd64        anti-virus utility for Unix - library

Test Case #1
------------

dpkg-reconfigure and chose:
TCP, port 3330, IP: 10.108.97.11

root@clamav-jammy-sru:~# sudo systemctl restart clamav-daemon

root@clamav-jammy-sru:~# sudo ss -pln | grep 3330
tcp   LISTEN 0      15                                   10.108.97.11:3330      
       0.0.0.0:*    users:(("clamd",pid=10989,fd=4))                            
   

root@clamav-jammy-sru:~# printf "PING\n" | nc 10.108.97.11 3330
PONG

root@clamav-jammy-sru:~# systemctl cat clamav-daemon.socket
# /lib/systemd/system/clamav-daemon.socket
[Unit]
...

[Socket]
ListenStream=/run/clamav/clamd.ctl
#ListenStream=1024
SocketUser=clamav
SocketGroup=clamav
RemoveOnStop=True

[Install]
WantedBy=sockets.target

# /run/systemd/generator/clamav-daemon.socket.d/listen.conf
# Automatically generated by clamav-daemon-socket-generator
# Based on configuration in /etc/clamav/clamd.conf
[Socket]
# Clear any existing ListenStream directives
ListenStream=
ListenStream=10.108.97.11:3330

Correctly configured a listening socket

Test Case #2
------------

root@clamav-jammy-sru:~# sudo dpkg-reconfigure clamav-daemon
# Set the socket to clamd-alt.ctl, socketgroup to clamav-user, socketmode to 777

root@clamav-jammy-sru:~# systemctl cat clamav-daemon.socket
# /lib/systemd/system/clamav-daemon.socket
[Unit]
...

[Socket]
ListenStream=/run/clamav/clamd.ctl
#ListenStream=1024
SocketUser=clamav
SocketGroup=clamav
RemoveOnStop=True

[Install]
WantedBy=sockets.target

# /run/systemd/generator/clamav-daemon.socket.d/listen.conf
# Automatically generated by clamav-daemon-socket-generator
# Based on configuration in /etc/clamav/clamd.conf
[Socket]
# Clear any existing ListenStream directives
ListenStream=

ListenStream=/var/run/clamav/clamd-alt.ctl
SocketMode=777
SocketGroup=clamav-user

root@clamav-jammy-sru:~# printf "PING\n" | socat - 
UNIX-CONNECT:/run/clamav/clamd-alt.ctl
PONG

Verification passed

** Tags removed: verification-needed-jammy
** Tags added: verification-done-jammy

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2129160

Title:
  [FFe] [SRU] dpkg-reconfigure clamav-daemon does not respect TCP
  configuration

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/clamav/+bug/2129160/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to