Bug 17428 - Falsche Parameteranzahl für clean-Eintrag in /etc/apt/mirror.list
Summary: Falsche Parameteranzahl für clean-Eintrag in /etc/apt/mirror.list
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: Update - univention-updater
Version: UCS 2.3
Hardware: Other Linux
: P5 normal
Target Milestone: UCS 2.3-2
Assignee: Philipp Hahn
QA Contact: Janek Walkenhorst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-21 14:15 CET by Philipp Hahn
Modified: 2010-05-18 09:59 CEST (History)
1 user (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):
Customer ID:
Max CVSS v3 score:
hahn: Patch_Available+


Attachments
Fix format string bug. (6.35 KB, patch)
2010-03-08 12:42 CET, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2010-01-21 14:15:54 CET
$ ucr set online/repository/clean=yes
$ python2.4 -c "from univention.updater import *;print UniventionUpdater().print_security_repositories(clean=True,all_security_updates=True)"

Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/univention/updater/tools.py", line 572, in print_security_repositories
    repos += 'clean %s/%d.%d/%s/sec%s/%s/\n' % ( self.repository(), start.major, start.minor, part, p )
TypeError: not enough arguments for format string

univention-updater/modules/univention/updater/tools.py#print_security_repositories
					if clean:
						if self.repository_prefix:
							repos += 'clean http://%s:%s/%s/%d.%d/%s/sec%s/%s/\n' % ( self.repository_server, self.repository_port, self.repository_prefix, start.major, start.minor, part, p )
						else:
							repos += 'clean http://%s:%s/%d.%d/%s/sec%s/%s/\n' % ( self.repository_server, self.repository_port, start.major, start.minor, part, p )

Das letzte "%s/" ist vermutlich zu viel, da da normalerweise die Archtitekturangabe steht.
Comment 1 Philipp Hahn univentionstaff 2010-01-21 16:10:07 CET
Weiterhin fehl auch die Registriefung von online/repository/clean für /etc/apt/mirror.list in debian/univention-updater.univention-config-registry:

# ucr set online/repository/clean=yes
Create online/repository/clean
#
Comment 2 Philipp Hahn univentionstaff 2010-03-08 12:42:58 CET
Created attachment 2326 [details]
Fix format string bug.

Fix wrong format string with online/repository/clean=true (Bug #17428)
Document online/repository/clean variable.
Fix handling of repository/online/component/%s/clean.

Sollte man "online/repository/clean" nicht besser in "repository/mirror/clean" umbenennen, da im Namen wohl "online" und "repository" vertauscht sind, und die Variable eigentlich nur in /etc/apt/mirror.conf verwendet wird?
Comment 3 Philipp Hahn univentionstaff 2010-05-10 14:15:46 CEST
Der Format-String taucht so in der falschen Form nicht mehr auf, somit ist das Problem behoben.

\item In der Funktionalität zum Entfernen nicht mehr benötigter Pakete aus
einem lokalen Repository (\ucsUCRV{online/repository/clean}) und beim Kopieren
der \texttt{preup.sh}- und \texttt{postup.sh}-Skripte in ein lokales
Repository wurde Formatierungsfehler korrigiert. (\ucsBug{17428},
\ucsBug{18040}).
Comment 4 Janek Walkenhorst univentionstaff 2010-05-10 15:08:37 CEST
Reopen: Die /etc/apt/mirror.list ist mit "yes" und "no" gleich - die clean-Zeilen sind immer vorhanden
Comment 5 Philipp Hahn univentionstaff 2010-05-10 16:43:02 CEST
5.0.75-1: Alle Tests der Bauart
  configRegistry.get(key, False)
ersett durch
  configRegistry.get(key, 'False').lower() in ('yes', 'true', 'enabled', '1')
Damit tut es dann auch mit 'ucr set' statt nur mit 'ucr unset'.

Keine Änderung am ChangeLog.
Comment 6 Stefan Gohmann univentionstaff 2010-05-18 09:59:58 CEST
UCS 2.3-2 wurde veröffentlicht. Sollte der hier beschriebene Bug mit einer neueren Version von UCS erneut auftreten, so sollte der Bug dupliziert werden:
"Clone This Bug".