🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
2 messages
2 total messages Started by Kenichiro Kakizaki Wed, 07 Oct 2026 12:40
Bug#1150230: [omv-00.umashika.ne.jp] apt-listchanges: configuration fragments are loaded in nondeterministic order
#38
Author: Kenichiro Kakizaki
Date: Wed, 07 Oct 2026 12:40
155 lines
7499 bytes
Package: apt-listchanges
Version: 4.8
Severity: normal
Tags: patch

Dear Maintainer,

I found that configuration fragments in /etc/apt/listchanges.conf.d/ are loaded in a nondeterministic order.

This caused different effective configurations on two Debian 13 systems even though they had the same apt-listchanges version and identical configuration files.

The relevant code in apt_listchanges/ALCConfig.py is:

    configs = [conf]
    configs += glob(os.path.join(conf_d, '*.conf'))
    self.read(configs)

Python's glob() does not guarantee any particular ordering. Therefore the order in which configuration fragments override each other depends on the directory enumeration order.

I reproduced this on two OpenMediaVault systems running Debian 13 and apt-listchanges 4.8.

Both systems contained these files:

    /etc/apt/listchanges.conf.d/95openmediavault.conf
    /etc/apt/listchanges.conf.d/98openmediavault-mail.conf

95openmediavault.conf contains:

    [apt]
    which=both
    email_address=none
    email_format=html
    headers=false
    reverse=false
    titled=true

98openmediavault-mail.conf contains:

    [apt]
    email_address=root

On the affected system, glob() returned:

    /etc/apt/listchanges.conf.d/98openmediavault-mail.conf
    /etc/apt/listchanges.conf.d/95openmediavault.conf

The resulting effective configuration was:

    frontend        = 'pager'
    which           = 'both'
    email_address   = None
    email_format    = 'html'

As a result, apt-listchanges did not send email because can_send_emails() returned False.

On another system with the same apt-listchanges version and the same configuration files, glob() returned:

    /etc/apt/listchanges.conf.d/95openmediavault.conf
    /etc/apt/listchanges.conf.d/98openmediavault-mail.conf

The resulting effective configuration was:

    email_address   = 'root'

and apt-listchanges email notifications worked correctly.

I tested the following one-line change on the affected system:

--- a/apt_listchanges/ALCConfig.py
+++ b/apt_listchanges/ALCConfig.py
@@
-        configs += glob(os.path.join(conf_d, '*.conf'))
+        configs += sorted(glob(os.path.join(conf_d, '*.conf')))

After applying this change, the effective configuration became:

    email_address = 'root'
    which         = 'both'
    email_format  = 'html'

I then performed a normal APT upgrade. The apt-listchanges hook ran normally and the expected apt-listchanges email was successfully sent.

Therefore, sorting the configuration fragment filenames before passing them to ConfigParser appears to fix the issue and makes the override order deterministic.

The problem was reproduced with apt-listchanges 4.8 from Debian trixie. I have not tested whether 4.8+nmu3 in testing/unstable is affected.

Regards,
Kenichiro Kakizaki

-- Package-specific info:
==> /etc/apt/listchanges.conf <==
[apt]
frontend=pager
which=news
email_address=root
email_format=text
confirm=false
headers=false
reverse=false
save_seen=/var/lib/apt/listchanges


==> /etc/apt/listchanges.conf.d/98openmediavault-mail.conf <==
[apt]
email_address=root

==> /etc/apt/listchanges.conf.d/95openmediavault.conf <==
# https://manpages.debian.org/trixie/apt-listchanges/apt-listchanges.1.en.html
[apt]
which=both
email_address=none
email_format=html
headers=false
reverse=false
titled=true

-- System Information:
Debian Release: 13.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 7.1.13+deb13-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages apt-listchanges depends on:
ii  apt                    3.0.3
ii  debconf [debconf-2.0]  1.5.91
ii  python3                3.13.5-1
ii  python3-apt            3.0.0
ii  python3-debconf        1.5.91
ii  sensible-utils         0.0.25
ii  ucf                    3.0052

apt-listchanges recommends no packages.

Versions of packages apt-listchanges suggests:
ii  postfix [mail-transport-agent]  3.10.13-0+deb13u1
pn  python3-gi                      <none>
pn  www-browser                     <none>
pn  x-terminal-emulator             <none>

-- debconf information:
* apt-listchanges/reverse: false
* apt-listchanges/email-format: text
* apt-listchanges/save-seen: true
* apt-listchanges/email-address: root
* apt-listchanges/frontend: pager
  apt-listchanges/no-network: false
* apt-listchanges/confirm: false
* apt-listchanges/headers: false
* apt-listchanges/which: news
Bug#1150230: [omv-00.umashika.ne.jp] apt-listchanges: configuration fragments are loaded in nondeterministic order
#115
Author: Kenichro Kakizaki
Date: Wed, 07 Oct 2026 22:10
31 lines
4025 bytes
------EK4XQTRUVJ2WXYUJP2LUHQNU01EX9T
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Wed, 7 Oct 2026 08:55:15 -0400 Jonathan Kamens <jik@kamens=2Eus> wrote:
> Good catch, and good fix=2E I will apply it=2E Do you want credit in the=
=20
> changelog, and if so, how would you like to be credited?
>=20

Hi Jonathan,
Yes, please=2E I'd be happy to be credited as "Kenichiro Kakizaki"=2E
Thank you for applying the fix!
Best regards,
Kenichiro Kakizaki

Ken1R Kakizaki
------EK4XQTRUVJ2WXYUJP2LUHQNU01EX9T
Content-Type: text/html;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html><html><body><div dir=3D"auto">On Wed, 7 Oct 2026 08:55:15 -0=
400 Jonathan Kamens &lt;jik@kamens=2Eus&gt; wrote:<br>&gt; Good catch, and =
good fix=2E I will apply it=2E Do you want credit in the <br>&gt; changelog=
, and if so, how would you like to be credited?<br>&gt; <br><br>Hi Jonathan=
,<br>Yes, please=2E I'd be happy to be credited as "Kenichiro Kakizaki"=2E<=
br>Thank you for applying the fix!<br>Best regards,<br>Kenichiro Kakizaki<b=
r></div><div dir=3D"auto">Ken1R Kakizaki</div></body></html>
------EK4XQTRUVJ2WXYUJP2LUHQNU01EX9T--
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads