Bug 24010 - Skript zum Finden von veränderten Template Dateien
Skript zum Finden von veränderten Template Dateien
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UCR
UCS 2.4
Other Linux
: P5 enhancement (vote)
: UCS 3.2-1-errata
Assigned To: Philipp Hahn
Stefan Gohmann
:
Depends on: 19279 31724
Blocks: 19316
  Show dependency treegraph
 
Reported: 2011-10-10 15:54 CEST by Janis Meybohm
Modified: 2014-03-17 13:00 CET (History)
4 users (show)

See Also:
What kind of report is it?: ---
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): Troubleshooting
Max CVSS v3 score:


Attachments
Prüft auf veränderte Templates (2.05 KB, patch)
2011-11-03 09:47 CET, Janis Meybohm
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Janis Meybohm univentionstaff 2011-10-10 15:54:33 CEST
+++ This bug was initially created as a clone of Bug #19279 +++

Es sollte ein Skript geschrieben werden, welches anhand der MD5 Summen prüft,
ob auf dem System veränderte Template Dateien vorhanden sind.

Dieses Skript sollte im postup.sh aufgerufen werden und eine Meldung ausgeben,
wenn veränderte Dateien gefunden wurden.

Zusätzlich sollte es eine Prüfung in ucs-test geben.
+++

Momentan wird "nur" auf dpkg-dist und dpkg-new Dateien geprüft, veränderte Templates werden daher erst _nach_ einem Update gefunden. Wurden auf einem UCS-System keine Updates eingespielt wird es von univention-check-templates immer als "sauber" erkannt.

Wie im ursprünglichen Bug beschrieben sollten hier besser die MD5 Summen der original Dateien überprüft werden, sowas in der Art:
sed -ne 's| /etc/univention/templates/files/|/etc/univention/templates/files/|p' /var/lib/dpkg/status | grep -v newconffile | awk '{print $2"  "$1}' | md5sum -c | awk -F': ' '$2 !~ /OK/{print $1}'
Comment 1 Janis Meybohm univentionstaff 2011-11-03 09:47:56 CET
Created attachment 3726 [details]
Prüft auf veränderte Templates

Das angehängte Script prüft auf tatsächlich veränderte Templates anhand der Prüfsummen. Aufgrund eines Bugs werden beim bauen der univention-* Pakete die Conffiles teilweise doppelt (und mit unterschiedlichen Prüfsummen) in die Conffile-Liste aufgenommen, daher ist die Prüfung nicht ganz so einfach wie im comment #0 angenommen.
Comment 2 Philipp Hahn univentionstaff 2014-03-03 10:47:42 CET
Again found missing during a UCS 3.2-1 Technical Training.

We should package this, as we recommend to revert all modifications to templates *before* performing an update. "univention-template-check" can only be used *after* the update, since it only checks for *.dpkg-* template files.
Comment 3 Stefan Gohmann univentionstaff 2014-03-10 08:45:40 CET
The new tool should replace univention-check-templates.
Comment 4 Philipp Hahn univentionstaff 2014-03-10 13:00:52 CET
univention-check-templates now also checks the MD5 sum of the template files. The old code to check for dpkg-renamed files was kept and converted into Python code.

ucs-3.2-1: r48425
univention-config-registry_9.0.6-6.454.201403101254
YAML: r48426
Comment 5 Philipp Hahn univentionstaff 2014-03-11 15:53:44 CET
Add debian.deb822 as Suggests, as it is only in unmaintained.
Add an alternative implementation to directly parse /var/lib/dpkg/status.

UCS-3.2-1: r48447
univention-config-registry_
YAML: r48448
Comment 6 Stefan Gohmann univentionstaff 2014-03-12 14:28:28 CET
I've added a simple test case: r48468 + r48469

Code: OK
YAML: OK
Tests: OK
Comment 7 Moritz Muehlenhoff univentionstaff 2014-03-17 13:00:33 CET
http://errata.univention.de/ucs/3.2/70.html