- Package:
- apt-cacher
- Source:
- apt-cacher
- Submitter:
- Chris Nospam
- Date:
- 2026-08-24 15:07:01 UTC
- Severity:
- normal
- Tags:
Perl shows warnings when executing apt-cacher-cleanup.pl in forky:
$ dpkg -l | grep apt-cacher
ii apt-cacher 1.7.33 all Caching proxy server for Debian/Ubuntu/Devuan software repositories
$ dpkg -l | grep 'ii perl '
ii perl 5.42.2-3 amd64 Larry Wall's Practical Extraction and Report Language
$ su -
Password:
$ /usr/share/apt-cacher/apt-cacher-cleanup.pl
Possible precedence problem between ! and pattern match (m//) at /usr/share/apt-cacher/apt-cacher-cleanup.pl line 114.
Possible precedence problem between ! and pattern match (m//) at /usr/share/apt-cacher/apt-cacher-cleanup.pl line 114.
$ cat /usr/share/apt-cacher/apt-cacher-cleanup.pl
...
# change uid and gid if root and another user/group configured
if (($cfg->{user} && $cfg->{user} !~ 'root' && !$> )
|| ($cfg->{group} && $cfg->{group} !~ 'root' && !$) =~ /^0/)){
...
Maybe it should be something like
if (($cfg->{user} && $cfg->{user} !~ 'root' && !$> )
|| ($cfg->{group} && $cfg->{group} !~ 'root' && !($) =~ /^0/))){
or
|| ($cfg->{group} && $cfg->{group} !~ 'root' && $) !~ /^0/)){
Thanks for apt-cacher!
Chris
Chris,
Thanks for this. I think you (and the new perl operator precedence warning) have
uncovered a longstanding bug.
Does this patch fix it for you?
Mark
commit 897ed6969cce556ebe48c81996e2dafc10b4b189
Author: Mark Hindley <mark@hindley.org.uk>
Date: Mon Aug 17 17:07:21 2026 +0100
Fix spurious negation operator before $) variable.
Longstanding bug exposed by new operator precedence warning in perl 5.42:
Possible precedence problem between ! and pattern match (m//) at
/usr/share/apt-cacher/apt-cacher-cleanup.pl line 114.
$) is a space separated string of group numbers. Intended test is whether first
group is 0, i.e. getegid() is root.
Closes: #1143251
diff --git a/apt-cacher-cleanup.pl b/apt-cacher-cleanup.pl
index 3e229dd..cec7e71 100755
--- a/apt-cacher-cleanup.pl
+++ b/apt-cacher-cleanup.pl
@@ -111,7 +111,7 @@ check_install(); # Before we give up rights
# change uid and gid if root and another user/group configured
if (($cfg->{user} && $cfg->{user} !~ 'root' && !$> )
- || ($cfg->{group} && $cfg->{group} !~ 'root' && !$) =~ /^0/)){
+ || ($cfg->{group} && $cfg->{group} !~ 'root' && $) =~ /^0/)){
printmsg("Invoked as root, changing to $cfg->{user}:$cfg->{group} and re-execing.\n");
setup_ownership($cfg);
# Rexec to ensure /proc/self/fd ownerships correct which are needed for red
We believe that the bug you reported is fixed in the latest version of apt-cacher, which is due to be installed in the Debian FTP archive. A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to 1143251@bugs.debian.org, and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Mark Hindley <mark@hindley.org.uk> (supplier of updated apt-cacher package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing ftpmaster@ftp-master.debian.org) Format: 1.8 Date: Mon, 24 Aug 2026 15:35:01 +0100 Source: apt-cacher Architecture: source Version: 1.7.34 Distribution: unstable Urgency: medium Maintainer: Mark Hindley <mark@hindley.org.uk> Changed-By: Mark Hindley <mark@hindley.org.uk> Closes: 1143251 Changes: apt-cacher (1.7.34) unstable; urgency=medium . * Fix spurious negation operator before $) variable. (Closes: #1143251) * d/control: change to debhelper compat 14 and drop obsolete substvars. Checksums-Sha1: aac3841357630658f657a3c36416f7d224ed6f24 1605 apt-cacher_1.7.34.dsc 04f7db7c74145442f9b3143b288eb21029597677 97460 apt-cacher_1.7.34.tar.xz a6cd888561a8d32ab8e2bc60038b367b30cdcd56 5410 apt-cacher_1.7.34_amd64.buildinfo Checksums-Sha256: cf6a34b593ea1a52837c72307020d7f555d278de9541622dddb51d1c0b37d34b 1605 apt-cacher_1.7.34.dsc 61e2a812f384abf94c28f3776ad0f649eea28e04886003c3e83bd93c8cc9c8b5 97460 apt-cacher_1.7.34.tar.xz cae91db17a014408e1a8bb3db043bd755a5bb8944caca53f9453c51eb52749d1 5410 apt-cacher_1.7.34_amd64.buildinfo Files: d8751a439845dd9df5de704585a686d4 1605 net optional apt-cacher_1.7.34.dsc dae0ab339245917f0042f5a91e172b4b 97460 net optional apt-cacher_1.7.34.tar.xz ce67a8fe1cf5b5a667d4faf50ce192b5 5410 net optional apt-cacher_1.7.34_amd64.buildinfo -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEUGwVpCsK9aCoVCPu0opFvzKH1kkFAmqMWTsACgkQ0opFvzKH 1kkcxA/9GklDQuXmAAOJPr1QJIjg6WgC/ENSeNXUMuTUZMo0JckQF32NDSKgRSWQ 6vNbr/P8GU+xPoVy8uYcYITr9ChvnTbUt/L3s5TP2iZ7sL1xRd+0/398OZbCT+VR vLexrQ0IxPtRVijWBFQbq7+xXKA3fhFSq5vG5OtDw3Z+zp6R8KDM7LN2ih7d61lp kcRE7AGo2v8ZS2iNKF/lyOWsbvFKUeFhTSHqzR1FMQ6COtJaPHv03p4d2ihzSmCu T5MSfSalEssdOQysBOcVZLtiZD3urP+mG/0u5TrW48/4lKbaENRH/Oq4BdEOGJm9 Dr+9kU0ZCRjWrrdkIpWNeKYxlUf9sHfuZTqe3YW18emY6yNo6xR4w4UAJ8UHSsrL 9g4nremIaE/39lTHGM4AwN3UK5lQyuPpUdFJPo7Wlk4YNOluoY8Px/t39fl8hFCJ sKIqPLjGnJVYJew3fxZOSnYj00XunCmaWbXQSvy14j+LorntsRnIYy8WQJ8x5asP rfgOmQqV/ZdlXtKRc97hYUeDYgoslltkAp8DWUo0kIhRhRIRxgN4qZGtNSHBqNKu PC86QWj0rjOTie9du21PzFm/VisRM34/zkaAS7bOIB8RfpfdnhRUrwHj/OGk7hVi ApyoeR5//A4isALmdBsnWhqAyCOKNKKuni7g2YLxDSTfEUko6Ww= =z8WH -----END PGP SIGNATURE-----