From: Tim Beale Date: Thu, 4 Oct 2018 01:37:44 +0000 (+1300) Subject: netcmd: Change Py3 incompatible long() for tombstone expunge X-Git-Tag: tdb-1.3.17~1319 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2c4b829a75001ec939f9ecbc0db0712758ece80;p=thirdparty%2Fsamba.git netcmd: Change Py3 incompatible long() for tombstone expunge The code to expunge tombstones uses long(), which is not Python3 compatible. Python3 uses int() instead, and works out how big it needs to be. As long as we don't run the samba-tool command on a 32-bit machine after the year 2038, then we should avoid any integer overflow on Python 2.x. Signed-off-by: Tim Beale Reviewed-by: Douglas Bagnall Reviewed-by: Gary Lockyer --- diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index 7d0af53adf4..f022e3718a6 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -3891,10 +3891,10 @@ This command expunges tombstones from the database.""" if current_time_string is not None: current_time_obj = time.strptime(current_time_string, "%Y-%m-%d") - current_time = long(time.mktime(current_time_obj)) + current_time = int(time.mktime(current_time_obj)) else: - current_time = long(time.time()) + current_time = int(time.time()) if len(ncs) == 0: res = samdb.search(expression="", base="", scope=ldb.SCOPE_BASE,