develooper Front page | perl.perl5.porters | Postings from September 2003

How to detect hash randomization?

Thread Next
From:
Elizabeth Mattijsen
Date:
September 7, 2003 14:41
Subject:
How to detect hash randomization?
Message ID:
p05111b00bb814d834439@[192.168.56.4]
If I build 21021 with:

   -Accflags=-DNO_HASH_SEED

I correctly get a Perl 5.8.1 with the same has keys order as 5.8.0, 
and which does _not_ listen to the environment variable 
PERL_HASH_SEED, but perl -V doesn't say that it has been built with 
-DNO_HASH_SEED.  Is this intentional, an oversight or a side-effect 
of having to use -Accflags?

I think people will want to be able to check if the Perl they're 
using, actually has randomized hash keys or not (e.g. issuing a 
warning in a module if keys are not random).  Checking Config.pm does 
not give you any clue at the moment, or am I missing something?

I realize I could do some tricks with starting another copy of the 
current Perl executor and yadda yadda yadda, but that feels rather 
kludgy to me.


Liz
=====================================================
perl -V output:

Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
   Platform:
     osname=linux, osvers=2.4.10-4gb, archname=i686-linux-thread-multi
     uname='linux bibi 2.4.10-4gb #1 fri sep 28 17:20:21 gmt 2001 i686 unknown '
     config_args='-de -Dusethreads'
     hint=recommended, useposix=true, d_sigaction=define
     usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64',
     optimize='-O3',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-fno-strict-aliasing -I/usr/local/include'
     ccversion='', gccversion='2.95.3 20010315 (SuSE)', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, 
Off_t='off_t', lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='cc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib
     libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
     libc=, so=so, useshrplib=false, libperl=libperl.a
     gnulibc_version='2.2.4'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
   Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES 
PERL_IMPLICIT_CONTEXT
   Locally applied patches:
   	MAINT21020
   Built under linux
   Compiled at Sep  7 2003 22:37:04
   %ENV:
     PERL_HASH_SEED="1"
   @INC:
     /usr/local/lib/perl5/5.8.1/i686-linux-thread-multi
     /usr/local/lib/perl5/5.8.1
     /usr/local/lib/perl5/site_perl/5.8.1/i686-linux-thread-multi
     /usr/local/lib/perl5/site_perl/5.8.1
     /usr/local/lib/perl5/site_perl


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About