1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

s4-pysamba: fixed double conversion of int32

if the number is already negative, we shouldn't convert it
This commit is contained in:
Andrew Tridgell 2011-08-05 14:02:39 +10:00 committed by Andrew Bartlett
parent fd04a38d50
commit ff58087a3f

View File

@ -52,6 +52,6 @@ def confirm(msg, forced = False, allow_all=False):
def normalise_int32(ivalue):
'''normalise a ldap integer to signed 32 bit'''
if int(ivalue) & 0x80000000:
if int(ivalue) & 0x80000000 and int(ivalue) > 0:
return str(int(ivalue) - 0x100000000)
return str(ivalue)