Phased updates not supported by apt test from hobbit-plugins packages

Bug #2003062 reported by Damien Martins
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
hobbit-plugins (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When a package phased update is installed, the apt test reports it as "not installed from apt repositories".
It appears the Perl regexp to test packages origin matches with non-phased updates, but not with phased updates.
As per line 228, the package origin is checked using 'apt-cache policy' output.
As per 'apt-cache policy $package_name$' output, phased updates contains extra text which does not match with the regexp.
Non-phased update details as per 'apt-cache policy firefox':
firefox:
  Installé : 1:1snap1-0ubuntu2
  Candidat : 1:1snap1-0ubuntu2
 Table de version :
 *** 1:1snap1-0ubuntu2 500
        500 http://ubuntu-archive.mirrors.proxad.net/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status
Phased update details as per 'apt-cache policy grub2-common':
grub2-common:
  Installé : 2.06-2ubuntu7.1
  Candidat : 2.06-2ubuntu7.1
 Table de version :
 *** 2.06-2ubuntu7.1 500 (phased 51%)
        500 http://ubuntu-archive.mirrors.proxad.net/ubuntu jammy-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.06-2ubuntu7 500
        500 http://ubuntu-archive.mirrors.proxad.net/ubuntu jammy/main amd64 Packages

The difference is here:
Non-phased:
 *** 1:1snap1-0ubuntu2 500
Phased:
 *** 2.06-2ubuntu7.1 500 (phased 51%)

I found the regexp to modify resides at line 250 in /usr/lib/xymon/client/ext/apt:
if (/^ (?: |\*\*\*) (\S*[^\s:]) (\d+)$/) {

I wrote, tested and validated the replacement regexp to match with both non-phased and phased updates:
if (/^ (?: |\*\*\*) (\S*[^\s:]) (\d+)( \(phased (\d+)%\))?$/){

So please consider updating the /usr/lib/xymon/client/ext/apt file with the modified regexp to allow apt test to behave correctly with packages phased updates.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: hobbit-plugins 20201127 [modified: usr/lib/xymon/client/ext/apt]
ProcVersionSignature: Ubuntu 5.15.0-58.64-generic 5.15.74
Uname: Linux 5.15.0-58-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu82.3
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Tue Jan 17 10:05:57 2023
InstallationDate: Installed on 2019-04-28 (1359 days ago)
InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Release amd64 (20190416)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=fr_FR.UTF-8
 SHELL=/bin/bash
SourcePackage: hobbit-plugins
UpgradeStatus: Upgraded to jammy on 2022-09-07 (131 days ago)
modified.conffile..etc.xymon.clientlaunch.d.apt.cfg: [modified]
modified.conffile..etc.xymon.clientlaunch.d.libs.cfg: [modified]
modified.conffile..etc.xymon.clientlaunch.d.ntpq.cfg: [modified]
mtime.conffile..etc.xymon.clientlaunch.d.apt.cfg: 2023-01-14T10:17:27.914388
mtime.conffile..etc.xymon.clientlaunch.d.libs.cfg: 2023-01-14T10:18:07.222497
mtime.conffile..etc.xymon.clientlaunch.d.ntpq.cfg: 2023-01-14T10:18:39.914890

CVE References

Revision history for this message
Damien Martins (damien.martins) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in hobbit-plugins (Ubuntu):
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.3 KiB)

This bug was fixed in the package hobbit-plugins - 20230211

---------------
hobbit-plugins (20230211) unstable; urgency=medium

  [ Axel Beckert ]
  * dirtyvcs: Automatically add existing repositories from
    /etc/xymon/dirty_vcs_dirs to /var/lib/xymon/.gitconfig's
    safe.directory setting to handle fallout of the fix for
    CVE-2022-24765. Thanks to Christian Herzog for the bug report!
    + Change owner and group of /var/lib/xymon/ to xymon:xymon.
  * Remove postinst code relevant for hobbit to xymon migration.
  * Remove debian/maintscript completely. Was relevant for migrations
    before 2015, i.e. before oldoldstable.
  * Replace all occurrences of egrep and fgrep with grep -E/-F.
    Thanks tarzeau for reporting this!
  * Fix typo in comment in libs.yaml.
  * yum: Don't count "Errno" as alert if it is prepended by a dash or
    followed by a full stop, e.g. in package names like perl-Errno.x86_64.
  * Mention explicitly in the package description that hard dependencies
    of plugins enabled by default are listed in Recommends and
    dependencies of plugins disabled by default are listed in
    Suggests. Based on the according comment in debian-goodies' package
    description. (Closes: #1016162)
  * Fix bogus "Last apt update: -0.0 day(s) ago" warning by adding a small
    tolerance. (Closes: #1021775)
  * Split off the kernel/reboot check from the libs check into a separate
    check. (Closes: #752776)
    + Do not warn (and just report "clear") if the kernel image can't be
      parsed. This doesn't prompt for an action by the administrator.
      (Currently a common, but non-trivial issue on armhf, see
      /usr/share/doc/hobbit-plugins/TODO.)
  * temp:
    + Suppress grep error message if a host has no
      /sys/class/scsi_generic/.
    + Also support more than 26 (and up to 676) disks, i.e. disks named
      /dev/sdaa to /dev/sdzz).
    + Support NVMe block devices via drivetemp.
    + Consistent paths below /sys/devices/platform/ and /sys/devices/pci*.
    + Completely remove hddtemp support. (Really closes: #1001950)
    + Report "clear" if no thermal zones or hwmons are found. Avoids going
      purple after hddtemp has been removed.
    + Report "yellow" if no thermal zones or hwmons are found and
      "drivetemp" driver is not loaded.
    + Fix "Use of uninitialized value" errors in exception handling.
  * Declare compliance with Debian Policy 4.6.2.
  * Add new server-side "xcl" check to query Lenovo XClarity API for
    hardware failure events. (disabled by default; add Suggests and B-D on
    libmojolicious-perl for usage of Mojo::JSON and Mojo::UserAgent)
  * Use more precise Files stanzas and update years in debian/copyright.
  * Also update my copyright years in some plugins.

  [ Adam Goryachev ]
  * kern: Be less strict in parsing kernel versions, allow trailing
    garbage as present on Ubuntu for Raspberry Pi. (LP: #1904807)

  [ Adam Thorn ]
  * apt: Properly parse phased packages on Ubuntu. (LP: #2002391,
    #2003062, #1995481)

  [ Debian Janitor ]
  * Remove constraints unnecessary since buster (oldstable):
    + Drop versioned build-dependency on essential package dpkg-dev.
    + Drop versioned pre-d...

Read more...

Changed in hobbit-plugins (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.