s4-pysamba: fixed double conversion of int32
authorAndrew Tridgell <tridge@samba.org>
Fri, 5 Aug 2011 04:02:39 +0000 (14:02 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 9 Aug 2011 09:56:23 +0000 (11:56 +0200)
if the number is already negative, we shouldn't convert it

source4/scripting/python/samba/common.py

index 867f44a116398ce29a6f94edaf6e7acdb46f16ff..5a9fae1c922447728b1d6d23a5f7fddba15ea455 100644 (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)