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
142 foreach(@SUPPORTED_ARCHITECTURES) {142 foreach(@SUPPORTED_ARCHITECTURES) {
143 printf "\t%s\n", $_;143 printf "\t%s\n", $_;
144 }144 }
145 printf("\n");
145 146
146 my $archname = $Config{archname};147 my $archname = `uname -m`;
147 printf "\n\$ perl -MConfig -e \'print \"\$Config{archname}\\n\"\'\n";148 printf("Machine hardware name (`uname -m`): %s\n", $archname);
148 printf "%s\n", $archname;
149 149
150 exit(129);150 exit(129);
151}151}
@@ -172,7 +172,7 @@ sub is_supported_architecture · 20 unmodified lines
172 172
173sub is_x86_64173sub is_x86_64
174{174{
175 my $archname = $Config{archname};175 my $archname = `uname -m`;
176 176
177 if ($archname =~ m/x86_64/) {177 if ($archname =~ m/x86_64/) {
178 return 1;178 return 1;
@@ -182,9 +182,9 @@ sub is_x86_64 · 3 unmodified lines
182 182
183sub is_ppc64183sub is_ppc64
184{184{
185 my $archname = $Config{archname};185 my $archname = `uname -m`;
186 186
187 if ($archname =~ m/powerpc/ and $archname =~ m/64/) {187 if ($archname =~ m/ppc64/) {
188 return 1;188 return 1;
189 }189 }
190 return 0;190 return 0;