summaryrefslogtreecommitdiff
path: root/fixprogs
diff options
context:
space:
mode:
authorAlistair Delva <adelva@google.com>2020-08-21 00:00:13 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-08-21 00:00:13 +0000
commited358b3546c776c1c677fd88eb8f716cf6187510 (patch)
tree3c6134bcb2cda4b9dccc57b4a8b997a945aab62d /fixprogs
parent22246b08952d746a7cc5a292570636cf4277598f (diff)
parent44a1065de8a58c51a021243a28bfa01e87822e4f (diff)
Merge changes I934c73d4,I28cdc9a0,I9e734da9,I3c079d86
* changes: UPSTREAM: depend UPSTREAM: upstream: avoid possible NULL deref; from Pedro Martelletto Revert "upstream: fix compilation with DEBUG_KEXDH; bz#3160 ok dtucker@" Merge upstream-master into master
Diffstat (limited to 'fixprogs')
-rwxr-xr-xfixprogs72
1 files changed, 0 insertions, 72 deletions
diff --git a/fixprogs b/fixprogs
deleted file mode 100755
index af76ee39..00000000
--- a/fixprogs
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/perl
-#
-# fixprogs - run through the list of entropy commands and
-# score out the losers
-#
-
-$entscale = 50; # divisor for optional entropy measurement
-
-sub usage {
- return("Usage: $0 <command file>\n");
-}
-
-if (($#ARGV == -1) || ($#ARGV>1)) {
- die(&usage);
-}
-
-# 'undocumented' option - run ent (in second param) on the output
-if ($#ARGV==1) {
- $entcmd=$ARGV[1]
-} else {
- $entcmd = ""
-};
-
-$infilename = $ARGV[0];
-
-if (!open(IN, "<".$infilename)) {
- die("Couldn't open input file");
-}
-$outfilename=$infilename.".out";
-if (!open(OUT, ">$outfilename")) {
- die("Couldn't open output file $outfilename");
-}
-@infile=<IN>;
-
-select(OUT); $|=1; select(STDOUT);
-
-foreach (@infile) {
- if (/^\s*\#/ || /^\s*$/) {
- print OUT;
- next;
- }
- ($cmd, $path, $est) = /^\"([^\"]+)\"\s+([\w\/_-]+)\s+([\d\.\-]+)/o;
- @args = split(/ /, $cmd);
- if (! ($pid = fork())) {
- # child
- close STDIN; close STDOUT; close STDERR;
- open (STDIN, "</dev/null");
- open (STDOUT, ">/dev/null");
- open (STDERR, ">/dev/null");
- exec $path @args;
- exit 1; # shouldn't be here
- }
- # parent
- waitpid ($pid, 0); $ret=$? >> 8;
-
- if ($ret != 0) {
- $path = "undef";
- } else {
- if ($entcmd ne "") {
- # now try to run ent on the command
- $mostargs=join(" ", splice(@args,1));
- print "Evaluating '$path $mostargs'\n";
- @ent = qx{$path $mostargs | $entcmd -b -t};
- @ent = grep(/^1,/, @ent);
- ($null, $null, $rate) = split(/,/, $ent[0]);
- $est = $rate / $entscale; # scale the estimate back
- }
- }
- print OUT "\"$cmd\" $path $est\n";
-}
-
-close(IN);