Package: ca-certificates-java
Version: 20260311
Severity: normal
Dear Maintainer,
In fresh mode, update_cacerts() in the postinst builds the list of
existing aliases like this (line 161; line breaks added):
cacerts_aliases=$(keytool ${castore} -storepass "$storepass" \
-list -rfc | sed -n 's/^Alias name: *debian://ip' \
| tr '\n' ' ')
keytool localises that label. Using the system Java (OpenJDK
25.0.5.1):
$ LANG=es_ES.UTF-8 keytool -cacerts -storepass changeit \
-list -rfc | grep -m1 -i alias
Nombre de Alias: debian:ac_raiz_fnmt-rcm.pem
$ LC_ALL=pt_BR.UTF-8 keytool -cacerts -storepass changeit \
-list -rfc | grep -m1 -i alias
Nome do alias: debian:ac_raiz_fnmt-rcm.pem
$ LC_ALL=C keytool -cacerts -storepass changeit \
-list -rfc | grep -m1 -i alias
Alias name: debian:ac_raiz_fnmt-rcm.pem
With a non-English locale the sed expression matches nothing, so
$cacerts_aliases is empty. No "-alias" line is ever written to
/var/lib/ca-certificates-java/fresh, and stale CAs stay trusted even
when fresh mode is reached. dpkg passes the caller's locale to
maintainer scripts, so this happens whenever apt/dpkg is run from a
non-English session, which is the normal case on a localised desktop.
(Fresh mode is currently reached only on initial install, on upgrades
from versions older than 20210218, and when cacerts is missing; see
#1155718 about the unreachable --fresh branch of the jks-keystore
hook. This bug becomes much more important if that reconciliation is
ever run more often.)
Suggested fix: force a fixed locale for the keytool call. For
example:
cacerts_aliases=$(LC_ALL=C keytool \
-J-Duser.language=en -J-Duser.country=US \
${castore} -storepass "$storepass" -list -rfc \
| sed -n 's/^Alias name: *debian://ip' | tr '\n' ' ')
On this system both "LC_ALL=C" and "-J-Duser.language=en
-J-Duser.country=US" (without LC_ALL) make keytool print
"Alias name:". Other keytool calls in the postinst whose output is
parsed should probably get the same treatment.
-- System Information:
Debian Release: forky/sid
Architecture: amd64
Kernel: Linux 7.3.6+deb14-amd64
Locale: LANG=es_ES.UTF-8, LC_MESSAGES=es_ES.UTF-8
parsed should probably get the same treatment.
-- System Information:
Debian Release: forky/sid
Architecture: amd64
Kernel: Linux 7.3.6+deb14-amd64
Locale: LANG=es_ES.UTF-8, LC_MESSAGES=es_ES.UTF-8
Relevant package versions:
ii ca-certificates 20261123
ii ca-certificates-java 20260311
ii openjdk-25-jre-headless 25.0.5.1+2-1