History

leaking_addresses: use system command to get arch

Currently script uses Perl to get the machine architecture. This can be erroneous since Perl uses the architecture of the machine that Perl was compiled on not the architecture of the running machine. We should use the systems `uname` command instead. Use `uname -m` instead of Perl to get the machine architecture.

Tobin C. Harding committed 8 years ago

Commit 6efb7451 parent 2f042c91 file · +6 −6Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/leaking_addresses.pl+6−6
@@ -142,10 +142,10 @@ if (!is_supported_architecture()) { · 141 unmodified lines
142142 foreach(@SUPPORTED_ARCHITECTURES) {
143143 printf "\t%s\n", $_;
144144 }
145+ printf("\n");
145146
146− my $archname = $Config{archname};
147− printf "\n\$ perl -MConfig -e \'print \"\$Config{archname}\\n\"\'\n";
148− printf "%s\n", $archname;
147+ my $archname = `uname -m`;
148+ printf("Machine hardware name (`uname -m`): %s\n", $archname);
149149
150150 exit(129);
151151 }
@@ -172,7 +172,7 @@ sub is_supported_architecture · 20 unmodified lines
172172
173173 sub is_x86_64
174174 {
175− my $archname = $Config{archname};
175+ my $archname = `uname -m`;
176176
177177 if ($archname =~ m/x86_64/) {
178178 return 1;
@@ -182,9 +182,9 @@ sub is_x86_64 · 3 unmodified lines
182182
183183 sub is_ppc64
184184 {
185− my $archname = $Config{archname};
185+ my $archname = `uname -m`;
186186
187− if ($archname =~ m/powerpc/ and $archname =~ m/64/) {
187+ if ($archname =~ m/ppc64/) {
188188 return 1;
189189 }
190190 return 0;