head	1.1;
branch	1.1.1;
access;
symbols
	RELENG_8_4:1.1.1.2.0.50
	RELENG_9_1_0_RELEASE:1.1.1.2
	RELENG_9_1:1.1.1.2.0.48
	RELENG_9_1_BP:1.1.1.2
	RELENG_8_3_0_RELEASE:1.1.1.2
	RELENG_8_3:1.1.1.2.0.46
	RELENG_8_3_BP:1.1.1.2
	RELENG_9_0_0_RELEASE:1.1.1.2
	RELENG_9_0:1.1.1.2.0.44
	RELENG_9_0_BP:1.1.1.2
	RELENG_9:1.1.1.2.0.42
	RELENG_9_BP:1.1.1.2
	RELENG_7_4_0_RELEASE:1.1.1.2
	RELENG_8_2_0_RELEASE:1.1.1.2
	RELENG_7_4:1.1.1.2.0.40
	RELENG_7_4_BP:1.1.1.2
	RELENG_8_2:1.1.1.2.0.38
	RELENG_8_2_BP:1.1.1.2
	RELENG_8_1_0_RELEASE:1.1.1.2
	RELENG_8_1:1.1.1.2.0.36
	RELENG_8_1_BP:1.1.1.2
	RELENG_7_3_0_RELEASE:1.1.1.2
	RELENG_7_3:1.1.1.2.0.34
	RELENG_7_3_BP:1.1.1.2
	RELENG_8_0_0_RELEASE:1.1.1.2
	RELENG_8_0:1.1.1.2.0.32
	RELENG_8_0_BP:1.1.1.2
	RELENG_8:1.1.1.2.0.30
	RELENG_8_BP:1.1.1.2
	RELENG_7_2_0_RELEASE:1.1.1.2
	RELENG_7_2:1.1.1.2.0.28
	RELENG_7_2_BP:1.1.1.2
	RELENG_7_1_0_RELEASE:1.1.1.2
	RELENG_6_4_0_RELEASE:1.1.1.2
	RELENG_7_1:1.1.1.2.0.26
	RELENG_7_1_BP:1.1.1.2
	RELENG_6_4:1.1.1.2.0.24
	RELENG_6_4_BP:1.1.1.2
	RELENG_7_0_0_RELEASE:1.1.1.2
	RELENG_6_3_0_RELEASE:1.1.1.2
	RELENG_7_0:1.1.1.2.0.22
	RELENG_7_0_BP:1.1.1.2
	RELENG_6_3:1.1.1.2.0.20
	RELENG_6_3_BP:1.1.1.2
	RELENG_7:1.1.1.2.0.18
	RELENG_7_BP:1.1.1.2
	RELENG_6_2_0_RELEASE:1.1.1.2
	RELENG_6_2:1.1.1.2.0.16
	RELENG_6_2_BP:1.1.1.2
	OpenSSH_4_5p1:1.1.1.2
	OpenSSH_4_4p1:1.1.1.2
	RELENG_5_5_0_RELEASE:1.1.1.2
	RELENG_5_5:1.1.1.2.0.14
	RELENG_5_5_BP:1.1.1.2
	RELENG_6_1_0_RELEASE:1.1.1.2
	RELENG_6_1:1.1.1.2.0.12
	RELENG_6_1_BP:1.1.1.2
	OpenSSH_4_3p1:1.1.1.2
	RELENG_6_0_0_RELEASE:1.1.1.2
	RELENG_6_0:1.1.1.2.0.10
	RELENG_6_0_BP:1.1.1.2
	OpenSSH_4_2p1:1.1.1.2
	RELENG_6:1.1.1.2.0.8
	RELENG_6_BP:1.1.1.2
	OpenSSH_4_1p1:1.1.1.2
	OpenSSH_4_0p1:1.1.1.2
	RELENG_5_4_0_RELEASE:1.1.1.2
	RELENG_5_4:1.1.1.2.0.6
	RELENG_5_4_BP:1.1.1.2
	RELENG_4_11_0_RELEASE:1.1.1.1.2.1
	RELENG_4_11:1.1.1.1.2.1.0.10
	RELENG_4_11_BP:1.1.1.1.2.1
	OpenSSH_3_9p1:1.1.1.2
	RELENG_5_3_0_RELEASE:1.1.1.2
	RELENG_5_3:1.1.1.2.0.4
	RELENG_5_3_BP:1.1.1.2
	RELENG_5:1.1.1.2.0.2
	RELENG_5_BP:1.1.1.2
	RELENG_4_10_0_RELEASE:1.1.1.1.2.1
	RELENG_4_10:1.1.1.1.2.1.0.8
	RELENG_4_10_BP:1.1.1.1.2.1
	OpenSSH_3_8_1p1:1.1.1.2
	OpenSSH_3_8p1:1.1.1.2
	RELENG_5_2_1_RELEASE:1.1.1.1
	RELENG_5_2_0_RELEASE:1.1.1.1
	OpenSSH_3_7_1p2:1.1.1.1
	RELENG_5_2:1.1.1.1.0.10
	RELENG_5_2_BP:1.1.1.1
	RELENG_4_9_0_RELEASE:1.1.1.1.2.1
	RELENG_4_9:1.1.1.1.2.1.0.6
	RELENG_4_9_BP:1.1.1.1.2.1
	RELENG_5_1_0_RELEASE:1.1.1.1
	RELENG_5_1:1.1.1.1.0.8
	RELENG_5_1_BP:1.1.1.1
	OpenSSH_3_6_1p1:1.1.1.1
	RELENG_4_8_0_RELEASE:1.1.1.1.2.1
	RELENG_4_8:1.1.1.1.2.1.0.4
	RELENG_4_8_BP:1.1.1.1.2.1
	RELENG_5_0_0_RELEASE:1.1.1.1
	RELENG_5_0:1.1.1.1.0.6
	RELENG_5_0_BP:1.1.1.1
	OpenSSH_3_5p1:1.1.1.1
	OPENSSH:1.1.1
	RELENG_4_7_0_RELEASE:1.1.1.1.2.1
	RELENG_4_7:1.1.1.1.2.1.0.2
	RELENG_4_7_BP:1.1.1.1.2.1
	RELENG_4_6_2_RELEASE:1.1.1.1.4.1
	RELENG_4_6_1_RELEASE:1.1.1.1.4.1
	RELENG_4_6:1.1.1.1.0.4
	RELENG_4:1.1.1.1.0.2
	OpenSSH_3_4p1:1.1.1.1
	OpenSSH_3_3p1:1.1.1.1
	OPENBSD:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2002.06.27.22.31.07;	author des;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2002.06.27.22.31.07;	author des;	state Exp;
branches
	1.1.1.1.2.1
	1.1.1.1.4.1;
next	1.1.1.2;

1.1.1.2
date	2004.02.26.10.38.40;	author des;	state Exp;
branches
	1.1.1.2.50.1;
next	;

1.1.1.1.2.1
date	2002.07.03.22.11.42;	author des;	state Exp;
branches;
next	;

1.1.1.1.4.1
date	2002.07.16.12.33.07;	author des;	state Exp;
branches;
next	;

1.1.1.2.50.1
date	2004.02.26.10.38.40;	author svnexp;	state dead;
branches;
next	1.1.1.2.50.2;

1.1.1.2.50.2
date	2013.03.28.13.02.25;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@#!/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);
@


1.1.1.1
log
@Vendor import of OpenSSH 3.3p1.
@
text
@@


1.1.1.2
log
@Vendor import of OpenSSH 3.8p1.
@
text
@d68 1
a68 1
  }
@


1.1.1.2.50.1
log
@file fixprogs was added on branch RELENG_8_4 on 2013-03-28 13:02:25 +0000
@
text
@d1 72
@


1.1.1.2.50.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 72
#!/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);
@


1.1.1.1.4.1
log
@Merge OpenSSH, OPIE, PAM and a number of dependencies from -STABLE.
@
text
@@


1.1.1.1.2.1
log
@Synch up to OpenSSH 3.4p1 - very nearly the same sources as in -CURRENT,
with a slightly different config.h to account for differences between
-CURRENT and -STABLE.

Privilege separation defaults to off for now as it breaks some aspects
of Kerberos authentication.

Sponsored by:	DARPA, NAI Labs
@
text
@@

