[openssl-dev] [openssl.org #4415] test/certs/mkcert.sh uses "#! /binbash"

Jeffrey Walton noloader at gmail.com
Sun Mar 13 10:44:13 UTC 2016


> ...
> Another potential pain point is PERL:
>
>     grep -iIR perl * | grep '#' | grep -v 'env' | wc -l
>     232
>
> It looks like most uses of PERL are expected to be at
> /usr/local/bin/perl. 160 of them use /usr/bin/env, but 230 or so use
> the potentially incorrect path.

This is testing OK if the change is acceptable:

$ cd openssl
$ find $PWD -name '*.pl' -exec sed -i
's|#!/usr/bin/perl|#!/usr/bin/env perl|g' {} \;
$ find $PWD -name '*.pl' -exec sed -i
's|#!/usr/local/bin/perl|#!/usr/bin/env perl|g' {} \;
$ find $PWD -name '*.pl' -exec sed -i 's|#!
/usr/bin/perl|#!/usr/bin/env perl|g' {} \;
$ find $PWD -name '*.pl' -exec sed -i 's|#!
/usr/local/bin/perl|#!/usr/bin/env perl|g' {} \;
-------------- next part --------------
diff --git a/VMS/VMSify-conf.pl b/VMS/VMSify-conf.pl
index 9890362..a726c26 100644
--- a/VMS/VMSify-conf.pl
+++ b/VMS/VMSify-conf.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 use warnings;
diff --git a/VMS/translatesyms.pl b/VMS/translatesyms.pl
index de3db6c..fec735c 100644
--- a/VMS/translatesyms.pl
+++ b/VMS/translatesyms.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#!/usr/bin/env perl
 
 # This script will translate any SYMBOL_VECTOR item that has a translation
 # in CXX$DEMANGLER_DB.  The latter is generated by and CC/DECC command that
diff --git a/apps/progs.pl b/apps/progs.pl
index f24b91b..219bd2c 100644
--- a/apps/progs.pl
+++ b/apps/progs.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 # Generate progs.h file by looking for command mains in list of C files
 # passed on the command line.
 
diff --git a/crypto/asn1/charmap.pl b/crypto/asn1/charmap.pl
index 878504f..cdfd80c 100644
--- a/crypto/asn1/charmap.pl
+++ b/crypto/asn1/charmap.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/env perl -w
 
 # Written by Dr Stephen N Henson (steve at openssl.org).
 # Licensed under the terms of the OpenSSL license.
diff --git a/crypto/bf/asm/bf-586.pl b/crypto/bf/asm/bf-586.pl
index 319a638..271e842 100644
--- a/crypto/bf/asm/bf-586.pl
+++ b/crypto/bf/asm/bf-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
diff --git a/crypto/bn/asm/bn-586.pl b/crypto/bn/asm/bn-586.pl
index 3f34abe..096bb9c 100644
--- a/crypto/bn/asm/bn-586.pl
+++ b/crypto/bn/asm/bn-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
diff --git a/crypto/bn/asm/co-586.pl b/crypto/bn/asm/co-586.pl
index ec3ea34..d0fe8ce 100644
--- a/crypto/bn/asm/co-586.pl
+++ b/crypto/bn/asm/co-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
diff --git a/crypto/bn/asm/x86.pl b/crypto/bn/asm/x86.pl
index c1cab72..a4441cf 100644
--- a/crypto/bn/asm/x86.pl
+++ b/crypto/bn/asm/x86.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 push(@INC,"perlasm","../../perlasm");
 require "x86asm.pl";
diff --git a/crypto/cast/asm/cast-586.pl b/crypto/cast/asm/cast-586.pl
index 267d699..ce9a06c 100644
--- a/crypto/cast/asm/cast-586.pl
+++ b/crypto/cast/asm/cast-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 # This flag makes the inner loop one cycle longer, but generates 
 # code that runs %30 faster on the pentium pro/II, 44% faster
diff --git a/crypto/conf/keysets.pl b/crypto/conf/keysets.pl
index a9baca4..bd14872 100644
--- a/crypto/conf/keysets.pl
+++ b/crypto/conf/keysets.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 $NUMBER=0x01;
 $UPPER=0x02;
diff --git a/crypto/des/asm/crypt586.pl b/crypto/des/asm/crypt586.pl
index d94528f..4affa39 100644
--- a/crypto/des/asm/crypt586.pl
+++ b/crypto/des/asm/crypt586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 #
 # The inner loop instruction sequence and the IP/FP modifications are from
 # Svend Olaf Mikkelsen <svolaf at inet.uni-c.dk>
diff --git a/crypto/des/asm/des-586.pl b/crypto/des/asm/des-586.pl
index e56eae4..236af07 100644
--- a/crypto/des/asm/des-586.pl
+++ b/crypto/des/asm/des-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 #
 # The inner loop instruction sequence and the IP/FP modifications are from
 # Svend Olaf Mikkelsen <svolaf at inet.uni-c.dk>
diff --git a/crypto/des/asm/desboth.pl b/crypto/des/asm/desboth.pl
index eec0088..aa5e9fe 100644
--- a/crypto/des/asm/desboth.pl
+++ b/crypto/des/asm/desboth.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 $L="edi";
 $R="esi";
diff --git a/crypto/lhash/num.pl b/crypto/lhash/num.pl
index 4440a99..3dad9b1 100644
--- a/crypto/lhash/num.pl
+++ b/crypto/lhash/num.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 #node     10 ->   4
 
diff --git a/crypto/md5/asm/md5-586.pl b/crypto/md5/asm/md5-586.pl
index b3b756c..3dfbdb7 100644
--- a/crypto/md5/asm/md5-586.pl
+++ b/crypto/md5/asm/md5-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 # Normal is the
 # md5_block_x86(MD5_CTX *c, ULONG *X);
diff --git a/crypto/md5/asm/md5-x86_64.pl b/crypto/md5/asm/md5-x86_64.pl
index 8d820e1..1009711 100755
--- a/crypto/md5/asm/md5-x86_64.pl
+++ b/crypto/md5/asm/md5-x86_64.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 #
 # MD5 optimized for AMD64.
 #
diff --git a/crypto/objects/obj_dat.pl b/crypto/objects/obj_dat.pl
index 0bf1e48..34ecf78 100644
--- a/crypto/objects/obj_dat.pl
+++ b/crypto/objects/obj_dat.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 # fixes bug in floating point emulation on sparc64 when
 # this script produces off-by-one output on sparc64
diff --git a/crypto/objects/objects.pl b/crypto/objects/objects.pl
index 107647a..a58e7c6 100644
--- a/crypto/objects/objects.pl
+++ b/crypto/objects/objects.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 open (NUMIN,"$ARGV[1]") || die "Can't open number file $ARGV[1]";
 $max_nid=0;
diff --git a/crypto/objects/objxref.pl b/crypto/objects/objxref.pl
index 7ebd74c..666b71e 100644
--- a/crypto/objects/objxref.pl
+++ b/crypto/objects/objxref.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 
diff --git a/crypto/perlasm/cbc.pl b/crypto/perlasm/cbc.pl
index 24561e7..4612638 100644
--- a/crypto/perlasm/cbc.pl
+++ b/crypto/perlasm/cbc.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 # void des_ncbc_encrypt(input, output, length, schedule, ivec, enc)
 # des_cblock (*input);
diff --git a/crypto/rc5/asm/rc5-586.pl b/crypto/rc5/asm/rc5-586.pl
index a0d85f2..3958bc1 100644
--- a/crypto/rc5/asm/rc5-586.pl
+++ b/crypto/rc5/asm/rc5-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
diff --git a/crypto/ripemd/asm/rmd-586.pl b/crypto/ripemd/asm/rmd-586.pl
index fd32a73..924cf11 100644
--- a/crypto/ripemd/asm/rmd-586.pl
+++ b/crypto/ripemd/asm/rmd-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 # Normal is the
 # ripemd160_block_asm_data_order(RIPEMD160_CTX *c, ULONG *X,int blocks);
diff --git a/ms/cmp.pl b/ms/cmp.pl
index 95b257f..7e03fae 100644
--- a/ms/cmp.pl
+++ b/ms/cmp.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 ($#ARGV == 1) || die "usage: cmp.pl <file1> <file2>\n";
 
diff --git a/os2/backwardify.pl b/os2/backwardify.pl
index 272423c..55c2dec 100644
--- a/os2/backwardify.pl
+++ b/os2/backwardify.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 use strict;
 
 # Use as $0
diff --git a/test/recipes/bc.pl b/test/recipes/bc.pl
index 29a4a8a..6de2e8b 100644
--- a/test/recipes/bc.pl
+++ b/test/recipes/bc.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 use warnings;
diff --git a/test/recipes/tconversion.pl b/test/recipes/tconversion.pl
index eeb25d0..3a2fd87 100644
--- a/test/recipes/tconversion.pl
+++ b/test/recipes/tconversion.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 use warnings;
diff --git a/test/run_tests.pl b/test/run_tests.pl
index f7bd623..fd5819c 100644
--- a/test/run_tests.pl
+++ b/test/run_tests.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 use warnings;
diff --git a/util/add_cr.pl b/util/add_cr.pl
index c7b62c1..825c238 100755
--- a/util/add_cr.pl
+++ b/util/add_cr.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 #
 # This adds a copyright message to a souce code file.
 # It also gets the file name correct.
diff --git a/util/check-buildinfo.pl b/util/check-buildinfo.pl
index f7d3baa..5e7e518 100644
--- a/util/check-buildinfo.pl
+++ b/util/check-buildinfo.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#!/usr/bin/env perl
 
 my %MINFO_source = ();
 
diff --git a/util/ck_errf.pl b/util/ck_errf.pl
index 922e5f6..8835e12 100755
--- a/util/ck_errf.pl
+++ b/util/ck_errf.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 #
 # This is just a quick script to scan for cases where the 'error'
 # function name in a XXXerr() macro is wrong.
diff --git a/util/copy-if-different.pl b/util/copy-if-different.pl
index ec99e08..2ab65ef 100755
--- a/util/copy-if-different.pl
+++ b/util/copy-if-different.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 
diff --git a/util/copy.pl b/util/copy.pl
index eba6d58..134503d 100644
--- a/util/copy.pl
+++ b/util/copy.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 use Fcntl;
 
diff --git a/util/dirname.pl b/util/dirname.pl
index d7a66d9..2995cb9 100644
--- a/util/dirname.pl
+++ b/util/dirname.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 if ($#ARGV < 0) {
     die "dirname.pl: too few arguments\n";
diff --git a/util/dofile.pl b/util/dofile.pl
index 983778f..703d639 100644
--- a/util/dofile.pl
+++ b/util/dofile.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#!/usr/bin/env perl
 #
 # Reads one or more template files and runs it through Text::Template
 #
diff --git a/util/extract-names.pl b/util/extract-names.pl
index 0f69335..5f1f2c4 100644
--- a/util/extract-names.pl
+++ b/util/extract-names.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 $/ = "";			# Eat a paragraph at once.
 while(<STDIN>) {
diff --git a/util/extract-section.pl b/util/extract-section.pl
index 7a0ba4f..2649e72 100644
--- a/util/extract-section.pl
+++ b/util/extract-section.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 while(<STDIN>) {
 	if (/=for\s+comment\s+openssl_manual_section:(\S+)/)
diff --git a/util/files.pl b/util/files.pl
index 32e7125..3b46442 100755
--- a/util/files.pl
+++ b/util/files.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 #
 # used to generate the file MINFO for use by util/mk1mf.pl
 # It is basically a list of all variables from the passed makefile
diff --git a/util/fipslink.pl b/util/fipslink.pl
index 7b16e04..a0720db 100644
--- a/util/fipslink.pl
+++ b/util/fipslink.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 sub check_env
 	{
diff --git a/util/mkbuildinf.pl b/util/mkbuildinf.pl
index a809f71..21b86f6 100755
--- a/util/mkbuildinf.pl
+++ b/util/mkbuildinf.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 my ($cflags, $platform) = @ARGV;
 
diff --git a/util/mkdef.pl b/util/mkdef.pl
index 4578c9a..ac3f962 100755
--- a/util/mkdef.pl
+++ b/util/mkdef.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/env perl -w
 #
 # generate a .def file
 #
diff --git a/util/mkdir-p.pl b/util/mkdir-p.pl
index e73d02b..bf054bd 100755
--- a/util/mkdir-p.pl
+++ b/util/mkdir-p.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 
 # mkdir-p.pl
 
diff --git a/util/mkerr.pl b/util/mkerr.pl
index 4fd5520..f0dca2c 100644
--- a/util/mkerr.pl
+++ b/util/mkerr.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/env perl -w
 
 my $config = "crypto/err/openssl.ec";
 my $hprefix = "openssl/";
diff --git a/util/mkfiles.pl b/util/mkfiles.pl
index 0e4f71e..e8c2d01 100755
--- a/util/mkfiles.pl
+++ b/util/mkfiles.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 #
 # This is a hacked version of files.pl for systems that can't do a 'make files'.
 # Do a perl util/mkminfo.pl >MINFO to build MINFO
diff --git a/util/perlpath.pl b/util/perlpath.pl
index a1f236b..517f326 100755
--- a/util/perlpath.pl
+++ b/util/perlpath.pl
@@ -1,6 +1,6 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 #
-# modify the '#!/usr/local/bin/perl'
+# modify the '#!/usr/bin/env perl'
 # line in all scripts that rely on perl.
 #
 
diff --git a/util/pl/BC-32.pl b/util/pl/BC-32.pl
index ef21b58..a21da2f 100644
--- a/util/pl/BC-32.pl
+++ b/util/pl/BC-32.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 # Borland C++ builder 3 and 4 -- Janez Jere <jj at void.si>
 #
 
diff --git a/util/pl/Mingw32.pl b/util/pl/Mingw32.pl
index 55c85f6..feab3e2 100644
--- a/util/pl/Mingw32.pl
+++ b/util/pl/Mingw32.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 #
 # Mingw32.pl -- Mingw
 #
diff --git a/util/pl/OS2-EMX.pl b/util/pl/OS2-EMX.pl
index 92a332e..5f54d36 100644
--- a/util/pl/OS2-EMX.pl
+++ b/util/pl/OS2-EMX.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 #
 # OS2-EMX.pl - for EMX GCC on OS/2
 #
diff --git a/util/pl/VC-32.pl b/util/pl/VC-32.pl
index 8ed6508..7750644 100644
--- a/util/pl/VC-32.pl
+++ b/util/pl/VC-32.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 # VC-32.pl - unified script for Microsoft Visual C++, covering Win32,
 # Win64 and WinCE [follow $FLAVOR variable to trace the differences].
 #
diff --git a/util/pl/linux.pl b/util/pl/linux.pl
index cb5dd59..054b825 100644
--- a/util/pl/linux.pl
+++ b/util/pl/linux.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 #
 # linux.pl - the standard unix makefile stuff.
 #
diff --git a/util/pl/ultrix.pl b/util/pl/ultrix.pl
index 2cccd11..d5b14d1 100644
--- a/util/pl/ultrix.pl
+++ b/util/pl/ultrix.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 #
 # linux.pl - the standard unix makefile stuff.
 #
diff --git a/util/pl/unix.pl b/util/pl/unix.pl
index 6add39a..2693287 100644
--- a/util/pl/unix.pl
+++ b/util/pl/unix.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 #
 # unix.pl - the standard unix makefile stuff.
 #
diff --git a/util/selftest.pl b/util/selftest.pl
index 06d494a..803115e 100644
--- a/util/selftest.pl
+++ b/util/selftest.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/env perl -w
 #
 # Run the test suite and generate a report
 #
diff --git a/util/sp-diff.pl b/util/sp-diff.pl
index 57e635b..8997110 100755
--- a/util/sp-diff.pl
+++ b/util/sp-diff.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
 #
 # This file takes as input, the files that have been output from
 # ssleay speed.


More information about the openssl-dev mailing list