🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #38

Bug#1150230: [omv-00.umashika.ne.jp] apt-listchanges: configuration fragments are loaded in nondeterministic order

#38
From: 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
Technical Details
Message-ID: <NLz69-44Qy-3@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!news.szaf.org!news.datentrampelpfad.de!news.imp.ch!news.corradoroberto.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!news.szaf.org!news.datentrampelpfad.de!news.imp.ch!news.corradoroberto.it!bofh.it!news.nic.it!robomod
From: Kenichiro Kakizaki <ken1r.kakizaki.omv@gmail.com>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1150230: [omv-00.umashika.ne.jp] apt-listchanges: configuration fragments are loaded in nondeterministic order
Date: Wed, 07 Oct 2026 14:40:01 +0200
Message-ID: <NLz69-44Qy-3@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Wed Oct  7 12:39:09 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -0.548
Reply-To: Kenichiro Kakizaki <ken1r.kakizaki.omv@gmail.com>, 1150230@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: jik@kamens.us
X-Debian-Pr-Message: report 1150230
X-Debian-Pr-Package: apt-listchanges
X-Debian-Pr-Keywords: patch
X-Debian-Pr-Source: apt-listchanges
X-Gm-Message-State: AFq9FYLIg37f0Ha7omqlKLB9imFNE0IJJh5yoMLb+ziWz7m09GgAKXP6
	53KJQHH7M4qg1IajRPB5BFb0lNojIaclvkamCQAJou4uRgFbQH42wwvPVdEPdQ==
X-Gm-Gg: AYBFou39auou82vdsboF0UD4A1j9LIzEHEvXoacUa6kTink3Qo0Ymtgsn8O3oqlbNI7
	yw4RE9urs2zWnbBN2rW+NzMjuX8F4h5SNtSU/uFFmXkFQCnfDV3SOzeFPymg5+dj7kpbKRtD/SK
	ZYPqc19wBzsK/1AQjYJt9xF61T+pbtAvWxJcfUZCHv9lc3pVa/fgQYfWhjvJJr2VCYz2SOp6Hqj
	k8EyVFBftdqpOYBvOOhvYLb808Dts9eFHTLHen9jH7pzO6PfWnH19juJgfJ+flJGw2teVIsciaF
	/jvj0XsgQh9307BxGS3Hk2qI0iMoQWnoAVr8zaHUbeLokROFm/BtclZaOjVw60IJeE+KbzuVOTV
	AM1dOvHjyW/REM0IcaU576Tr+o2rEUKxndMYjT4WFOpu53llo7akaaAOCuvpbrdvvrybqvXqHXJ
	wXECvbSVEOyhxLauVUFtLXxbsgyWQwFfLxjJihBI/9pmqs1T8ygBBANeUgGbbVaC+21imDDa7lf
	Gq8KWScc4THRy9oNXJYwB9CEs+lde9TRvZvGsEW6UsNwDOvCRD987Tf6XIsAg6K
X-Received: by 2002:a05:6a00:2183:b0:88b:7e32:d96 with SMTP id d2e1a72fcca58-891ae9e0ebamr1645147b3a.1.1791376581079;
        Wed, 07 Oct 2026 05:36:21 -0700 (PDT)
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Mailer: reportbug 13.2.0
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1995533
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 155
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Wed, 07 Oct 2026 21:36:17 +0900
X-Original-Message-ID: <179137657703.2001760.3266397302034001509.reportbug@omv-00.umashika.ne.jp>