From c4c945b38c5ec48267bdebe959a21d5c6f7e5a4a Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Wed, 23 Aug 2017 18:32:59 -0400 Subject: [PATCH] LP#1527731: Force stable hash key ordering Due to changes in Perl internals, some perl<->json assumptions no longer hold as of perl 5.18. This commit forces stable hash key generation and ordering so that some of our uses do not suffer. Signed-off-by: Mike Rylander --- bin/opensrf-perl.pl.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/opensrf-perl.pl.in b/bin/opensrf-perl.pl.in index 40015e3..e20403d 100755 --- a/bin/opensrf-perl.pl.in +++ b/bin/opensrf-perl.pl.in @@ -14,6 +14,16 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # --------------------------------------------------------------- + +BEGIN { + #warn("Checking PERL_HASH_SEED...\n"); + if (!defined($ENV{PERL_HASH_SEED}) or $ENV{PERL_HASH_SEED} !=0) { + my $cmd = join(' ', 'PERL_HASH_SEED=0 /usr/bin/perl', $0, @ARGV); + #warn("Restarting with PERL_HASH_SEED=0: $cmd \n"); + exec($cmd) or die "Cannot exec"; + } +} + use strict; use warnings; use Getopt::Long; use Net::Domain qw/hostfqdn/; -- 2.11.0