Bug 18926 - Fehlerhaftes if-elif-else-Konstrukt in uldap.py
Fehlerhaftes if-elif-else-Konstrukt in uldap.py
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 2.3
Other Linux
: P5 normal (vote)
: UCS 2.4
Assigned To: Philipp Hahn
Felix Botner
:
Depends on:
Blocks: 18929
  Show dependency treegraph
 
Reported: 2010-07-06 17:16 CEST by Philipp Hahn
Modified: 2010-08-31 13:21 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):
Max CVSS v3 score:
hahn: Patch_Available+


Attachments
Test-Skript (1.04 KB, text/plain)
2010-07-06 17:16 CEST, Philipp Hahn
Details
"elif" statt "if" (1.34 KB, patch)
2010-07-06 17:20 CEST, 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-07-06 17:16:04 CEST
Created attachment 2489 [details]
Test-Skript

In dev/ucs/base/univention-python/modules/uldap.py#modify gibt es folgendes
Konstrukt:

  if key == 'homePostalAddress': ...
    val=homePostalAddress
  if key == 'pager': ...
    val=postalAddress
  if key == 'mobile': ...
    val=mobileTelephoneNumber
  if key == 'pagerTelephoneNumber': ...
    val=pagerTelephoneNumber
  if key == "jpegPhoto":
    val=None
  else:
    val=oldvalue

Da dort "if" statt "elif" verwendet wird, tritt für die ersten 4 Fälle auch
immer der 'else'-Fall ein, der 'val' überschreibt.
Comment 1 Philipp Hahn univentionstaff 2010-07-06 17:20:19 CEST
Created attachment 2490 [details]
"elif" statt "if"
Comment 2 Philipp Hahn univentionstaff 2010-07-06 18:34:30 CEST
Fehler wurde in trunk/ korrigiert und Paket wurde für UCS_2.4neu gebaut.

Das Test-Skript aus Attachment 2489 [details] funktioniert danach (wirft aber eine Exception wegen fehlender Samba-SID, was hier aber nicht weiter relevant ist).

ChangeLog-Eintrag:
\item Im Paket \ucsName{univention-python} wurden ein Problem beim Verändern
von mehrwertigen Feldern korrigiert (\ucsBug{18926}).
Comment 3 Felix Botner univentionstaff 2010-08-11 16:59:48 CEST
OK, funktioniert.

Changelog Eintrag ist vorhanden.
Comment 4 Stefan Gohmann univentionstaff 2010-08-31 13:21:50 CEST
UCS 2.4 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".