Bug 33989 - Function logonHoursUnmap in UDM module users/user suspicious
Function logonHoursUnmap in UDM module users/user suspicious
Status: CLOSED DUPLICATE of bug 28496
Product: UCS
Classification: Unclassified
Component: UMC - Users
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 3.x
Assigned To: UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-24 15:10 CET by Alexander Kläser
Modified: 2017-06-28 18:32 CEST (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): Cleanup
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kläser univentionstaff 2014-01-24 15:10:58 CET
The following function in the users/user UDM module seems suspicious, does it actually work, as "times" is not being modified, thus the while condition seems to stay True once it is True. (Also the indentation is mixed with spaces/tabs, I am not sure which indentation is correct.)

def logonHoursUnmap(logontimes):
    "converts the string to a bit array"

    times=logontimes[0][:42]
    while len(times)<42:
        times=times
        ret=""
        for i in range(0,42,2):
            val=int(times[i:i+2],16)
            ret+=intToBinary(val)
Comment 1 Dirk Wiesenthal univentionstaff 2014-01-24 15:45:29 CET
Indentation is correct. 1 Tab = 8 Space if mixed (but this should be avoided).

def logonHoursUnmap(logontimes):
    "converts the string to a bit array"

    times=logontimes[0][:42]
    while len(times)<42:
        times=times
        ret=""
    for i in range(0,42,2):
        val=int(times[i:i+2],16)
        ret+=intToBinary(val)

BTW. I prefer DUPLICATE with Bug #28496 (rewrite sambaLogonHoursMap/Unmap)
Comment 2 Dirk Wiesenthal univentionstaff 2014-01-24 15:45:57 CET
Sorry

def logonHoursUnmap(logontimes):
    "converts the string to a bit array"

    times=logontimes[0][:42]
    while len(times)<42:
        times=times
    ret=""
    for i in range(0,42,2):
        val=int(times[i:i+2],16)
        ret+=intToBinary(val)
Comment 3 Philipp Hahn univentionstaff 2014-11-17 14:06:50 CET

*** This bug has been marked as a duplicate of bug 28496 ***