From b9ec4d1a679f1485c9c109969e891269627d9f7f Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Tue, 13 Aug 2013 02:10:01 -0400 Subject: Prevent *.pyo and *.pyc multilib problems Differences in the python byte code fails in a build validation (rpmdiff) done on difference architecture of the same package. This patch: 1) Ensures that timestamps of generated *.pyo and *.pyc files match 2) Python integer literals greater or equal 2^32 and lower than 2^64 are converted to long right away to prevent different type of the integer on architectures with different size of int https://fedorahosted.org/freeipa/ticket/3858 --- Makefile | 2 ++ daemons/configure.ac | 1 + install/configure.ac | 1 + ipa-client/configure.ac | 1 + ipalib/plugins/trust.py | 2 +- ipapython/certmonger.py | 4 ++-- ipaserver/install/certs.py | 2 +- ipaserver/install/ipa_backup.py | 2 +- ipaserver/install/ipa_restore.py | 2 +- ipatests/test_xmlrpc/test_dns_plugin.py | 2 +- 10 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 484144fd..674143b8 100644 --- a/Makefile +++ b/Makefile @@ -122,6 +122,7 @@ version-update: release-update > ipatests/setup.py perl -pi -e "s:__NUM_VERSION__:$(IPA_NUM_VERSION):" ipapython/version.py perl -pi -e "s:__API_VERSION__:$(IPA_API_VERSION_MAJOR).$(IPA_API_VERSION_MINOR):" ipapython/version.py + touch -r ipapython/version.py.in ipapython/version.py sed -e s/__VERSION__/$(IPA_VERSION)/ daemons/ipa-version.h.in \ > daemons/ipa-version.h perl -pi -e "s:__NUM_VERSION__:$(IPA_NUM_VERSION):" daemons/ipa-version.h @@ -135,6 +136,7 @@ version-update: release-update if [ "$(SUPPORTED_PLATFORM)" != "" ]; then \ sed -e s/SUPPORTED_PLATFORM/$(SUPPORTED_PLATFORM)/ ipapython/services.py.in \ > ipapython/services.py; \ + touch -r ipapython/services.py.in ipapython/services.py; \ fi if [ "$(SKIP_API_VERSION_CHECK)" != "yes" ]; then \ diff --git a/daemons/configure.ac b/daemons/configure.ac index 835d0b36..e57dad27 100644 --- a/daemons/configure.ac +++ b/daemons/configure.ac @@ -20,6 +20,7 @@ AC_HEADER_STDC AM_CONDITIONAL([HAVE_GCC], [test "$ac_cv_prog_gcc" = yes]) AC_SUBST(VERSION) +AC_SUBST([INSTALL_DATA], ['$(INSTALL) -m 644 -p']) dnl --------------------------------------------------------------------------- dnl - Check for NSPR/NSS diff --git a/install/configure.ac b/install/configure.ac index 29254e6e..09ed9f1b 100644 --- a/install/configure.ac +++ b/install/configure.ac @@ -18,6 +18,7 @@ AM_MAINTAINER_MODE #AC_HEADER_STDC AC_SUBST(VERSION) +AC_SUBST([INSTALL_DATA], ['$(INSTALL) -m 644 -p']) AC_PROG_MKDIR_P AC_PROG_AWK diff --git a/ipa-client/configure.ac b/ipa-client/configure.ac index 880e9289..bb4ac854 100644 --- a/ipa-client/configure.ac +++ b/ipa-client/configure.ac @@ -22,6 +22,7 @@ AC_HEADER_STDC AM_CONDITIONAL([HAVE_GCC], [test "$ac_cv_prog_gcc" = yes]) AC_SUBST(VERSION) +AC_SUBST([INSTALL_DATA], ['$(INSTALL) -m 644 -p']) dnl --------------------------------------------------------------------------- dnl - Check for KRB5 diff --git a/ipalib/plugins/trust.py b/ipalib/plugins/trust.py index 8790dcd2..6c7ea560 100644 --- a/ipalib/plugins/trust.py +++ b/ipalib/plugins/trust.py @@ -561,7 +561,7 @@ sides. base_id = DEFAULT_RANGE_SIZE + ( pysss_murmur.murmurhash3( dom_sid, - len(dom_sid), 0xdeadbeef + len(dom_sid), 0xdeadbeefL ) % 10000 ) * DEFAULT_RANGE_SIZE diff --git a/ipapython/certmonger.py b/ipapython/certmonger.py index d347c2ae..03f4b237 100644 --- a/ipapython/certmonger.py +++ b/ipapython/certmonger.py @@ -398,7 +398,7 @@ def dogtag_start_tracking(ca, nickname, pin, pinfile, secdir, pre_command, if pre_command is not None: if not os.path.isabs(pre_command): - if sys.maxsize > 2**32: + if sys.maxsize > 2**32L: libpath = 'lib64' else: libpath = 'lib' @@ -408,7 +408,7 @@ def dogtag_start_tracking(ca, nickname, pin, pinfile, secdir, pre_command, if post_command is not None: if not os.path.isabs(post_command): - if sys.maxsize > 2**32: + if sys.maxsize > 2**32L: libpath = 'lib64' else: libpath = 'lib' diff --git a/ipaserver/install/certs.py b/ipaserver/install/certs.py index 6d01d2be..8d7b7d0d 100644 --- a/ipaserver/install/certs.py +++ b/ipaserver/install/certs.py @@ -540,7 +540,7 @@ class CertDB(object): /usr/lib[64]/ipa/certmonger. """ if command is not None and not os.path.isabs(command): - if sys.maxsize > 2**32: + if sys.maxsize > 2**32L: libpath = 'lib64' else: libpath = 'lib' diff --git a/ipaserver/install/ipa_backup.py b/ipaserver/install/ipa_backup.py index 54694c99..8326bb0c 100644 --- a/ipaserver/install/ipa_backup.py +++ b/ipaserver/install/ipa_backup.py @@ -561,7 +561,7 @@ class Backup(admintool.AdminTool): if instance != 'PKI-IPA': return os.path.join('/var/lib/dirsrv', 'scripts-%s' % instance) else: - if sys.maxsize > 2**32: + if sys.maxsize > 2**32L: libpath = 'lib64' else: libpath = 'lib' diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py index 760da0ba..35cc6a51 100644 --- a/ipaserver/install/ipa_restore.py +++ b/ipaserver/install/ipa_restore.py @@ -593,7 +593,7 @@ class Restore(admintool.AdminTool): if instance != 'PKI-IPA': return os.path.join('/var/lib/dirsrv', 'scripts-%s' % instance) else: - if sys.maxsize > 2**32: + if sys.maxsize > 2**32L: libpath = 'lib64' else: libpath = 'lib' diff --git a/ipatests/test_xmlrpc/test_dns_plugin.py b/ipatests/test_xmlrpc/test_dns_plugin.py index 9a3ce667..1bfaee71 100644 --- a/ipatests/test_xmlrpc/test_dns_plugin.py +++ b/ipatests/test_xmlrpc/test_dns_plugin.py @@ -1254,7 +1254,7 @@ class test_dns(Declarative): dict( desc='Set SOA serial of zone %r to high number' % dnszone1, - command=('dnszone_mod', [dnszone1], {'idnssoaserial': 4294967295}), + command=('dnszone_mod', [dnszone1], {'idnssoaserial': 4294967295L}), expected={ 'value': dnszone1, 'summary': None, -- cgit