Bug 38659 - undefined name 'm' in M2Crypto/ASN1.py
undefined name 'm' in M2Crypto/ASN1.py
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: Upstream packages
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0-x
Assigned To: UCS maintainers
https://github.com/martinpaljak/M2Cry...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-06-08 11:12 CEST by Florian Best
Modified: 2019-01-03 07:17 CET (History)
0 users

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): Error handling, External feedback
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 2015-06-08 11:12:30 CEST
There is a typo in M2Crypto/ASN1.py which causes the reported traceback.

Traceback occurs when opening a user object in UMC which has a user certificate with an invalid month string.
(not in ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug","Sep", "Oct", "Nov", "Dec"])

A fix would be easy: s/m/month/.
I am not completely sure if there are followup errors: why is there a invalid user certificate in LDAP? We should also either validate it or sanitize the values.

Die Ausführung des Kommandos udm/get users/user ist fehlgeschlagen:

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 207, in _decorated
    return function(self, request, *args, **kwargs)
  File "%PY2.7%/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "%PY2.7%/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 475, in _thread
    obj = module.get(ldap_dn)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 163, in _decorated
    return func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 146, in wrapper_func
    return _func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 139, in _func
    ret = func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 620, in get
    obj.open()
  File "%PY2.7%/univention/admin/handlers/users/user.py", line 1529, in open
    self.reload_certificate()
  File "%PY2.7%/univention/admin/handlers/users/user.py", line 1572, in reload_certificate
    values = load_certificate(certificate)
  File "%PY2.7%/univention/admin/handlers/users/user.py", line 1154, in load_certificate
    'certificateDateNotAfter': x509.get_not_after().get_datetime().date().isoformat(),
  File "/usr/lib/python2.7/dist-packages/M2Crypto/ASN1.py", line 177, in get_datetime
    raise ValueError("Invalid date %s: Invalid month: %s" % (date, m))
NameError: global name 'm' is not defined

Remark:
Benutzerzertifikat vom Win 7 Client bei PKI Einstellungen hinterlegt

Version:
4.0-2 errata205 (Walle)
Comment 1 Florian Best univentionstaff 2015-06-16 12:15:06 CEST
1) Schritte, um den Fehler zu reproduzieren
Nachdem ich zu Testzwecken ein Userzertifikat (***_ucs.cer)
beim User *** importiert hatte, ließ sich der User
anschließend in der UCS-Konsolenverwaltung nicht mehr aufrufen.
Alle anderen Benutzer haben keine Zertifikate. Dort ist alles ok -
Benutzerverwaltung des jeweiligen Users lässt sich aufrufen.
Beim Benutzer andre.wolsing mit Zertifikat kommt die Fehlermeldung nun
jedesmal wenn ich den User in der UCS-Verwaltung aufrufen will.

2) erwartetes Ergebnis
Benutzerprofil des Users kann aufgerufen werden.

3) beobachtetes Ergebnis
Benutzerprofil des Users kann nicht aufgerufen werden.
Comment 2 Florian Best univentionstaff 2015-10-13 17:01:16 CEST
Fixed in upstream version 0.22.4.
Comment 3 Stefan Gohmann univentionstaff 2019-01-03 07:17:32 CET
This issue has been filled against UCS 4.0. The maintenance with bug and security fixes for UCS 4.0 has ended on 31st of May 2016.

Customers still on UCS 4.0 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.