Bug 43411 - univention-check-templates is broken
univention-check-templates is broken
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UCR
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.2
Assigned To: Florian Best
Janek Walkenhorst
: interim-3
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-01-24 16:07 CET by Florian Best
Modified: 2017-04-04 18:29 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2017-01-24 16:07:25 CET
univention-check-templates uses the parser from debian.deb822.Deb822.iter_paragraphs which is broken in UCS 4.2.

But the function has an parameter use_apt_pkg=True which uses python-apt for the task and is much much faster as told in the docstring. Therefore it is also more strict. But as '/var/lib/dpkg/status' is written by dpkg/apt itself this should be always valid?!

Demonstrating the brokenness:
>>> from debian.deb822 import Deb822
>>> list(Deb822.iter_paragraphs(open('/var/lib/dpkg/status', 'r'), ["Conffiles"], use_apt_pkg=False))
[{'Conffiles': u'\n /etc/dbus-1/system.d/org.freedesktop.UDisks.conf ed1fcf897e31049909a921f2b4cfd026\n /etc/avahi/services/udisks.service a0372c812d283ec1973c2461afd64774'}]
>>> list(Deb822.iter_paragraphs(open('/var/lib/dpkg/status', 'r').read(), ["Conffiles"], use_apt_pkg=False))
[{'Conffiles': u'\n /etc/dbus-1/system.d/org.freedesktop.UDisks.conf ed1fcf897e31049909a921f2b4cfd026\n /etc/avahi/services/udisks.service a0372c812d283ec1973c2461afd64774'}]
>>> list(Deb822.iter_paragraphs(open('/var/lib/dpkg/status', 'r').read().decode('latin-1'), ["Conffiles"], use_apt_pkg=False))
[{'Conffiles': u'\n /etc/dbus-1/system.d/org.freedesktop.UDisks.conf ed1fcf897e31049909a921f2b4cfd026\n /etc/avahi/services/udisks.service a0372c812d283ec1973c2461afd64774'}]
>>> list(Deb822.iter_paragraphs(open('/var/lib/dpkg/status', 'r').read().decode('utf-8'), ["Conffiles"], use_apt_pkg=False))
[{'Conffiles': u'\n /etc/dbus-1/system.d/org.freedesktop.UDisks.conf ed1fcf897e31049909a921f2b4cfd026\n /etc/avahi/services/udisks.service a0372c812d283ec1973c2461afd64774'}]
>>> list(Deb822.iter_paragraphs(open('/var/lib/dpkg/status', 'r').read().splitlines(), ["Conffiles"], use_apt_pkg=False))
[{'Conffiles': u'\n /etc/dbus-1/system.d/org.freedesktop.UDisks.conf ed1fcf897e31049909a921f2b4cfd026\n /etc/avahi/services/udisks.service a0372c812d283ec1973c2461afd64774'}]
Comment 1 Florian Best univentionstaff 2017-01-24 16:15:23 CET
univention-config-registry (12.0.1-1):
r76060 | Bug #43411: fix univention-check-templates
Comment 2 Stefan Gohmann univentionstaff 2017-04-04 18:29:32 CEST
UCS 4.2 has been released:
 https://docs.software-univention.de/release-notes-4.2-0-en.html
 https://docs.software-univention.de/release-notes-4.2-0-de.html

If this error occurs again, please use "Clone This Bug".