t/op/taint.t are not cleaning up the VMS logical names that they may
have modified or created.
$ENV{PATH} and $ENV{TERM} are magical on VMS and are dynamically created
in the local environment table. By default PERL on VMS writes the
modified name into the process logical name table, which makes them
persistent after Perl exits.
So save the original values, and put them back the best that we can, but
do not set them to empty strings, as that will break things, like
subsequent tests.
-John
[EMAIL PROTECTED]
Personal Opinion Only
--- /rsync_root/perl/t/op/taint.t Wed Nov 7 13:22:26 2007
+++ t/op/taint.t Sun Nov 11 19:54:42 2007
@@ -23,7 +23,11 @@
use vars qw($ipcsysv); # did we manage to load IPC::SysV?
+my ($old_env_path, $old_env_dcl_path, $old_env_term);
BEGIN {
+ $old_env_path = $ENV{'PATH'};
+ $old_env_dcl_path = $ENV{'DCL$PATH'};
+ $old_env_term = $ENV{'TERM'};
if ($^O eq 'VMS' && !defined($Config{d_setenv})) {
$ENV{PATH} = $ENV{PATH};
$ENV{TERM} = $ENV{TERM} ne ''? $ENV{TERM} : 'dummy';
@@ -57,11 +61,22 @@
for $x ('DCL$PATH', @MoreEnv) {
($old{$x}) = $ENV{$x} =~ /^(.*)$/ if exists $ENV{$x};
}
+ # VMS note: PATH and TERM are automatically created by the C
+ # library in VMS on reference to the their keys in %ENV.
+ # There is currently no way to determine if they did not exist
+ # before this test was run.
eval <<EndOfCleanup;
END {
- \$ENV{PATH} = '' if $Config{d_setenv};
- warn "# Note: logical name 'PATH' may have been deleted\n";
+ \$ENV{PATH} = \$old_env_path;
+ warn "# Note: logical name 'PATH' may have been created\n";
+ \$ENV{'TERM'} = \$old_env_term;
+ warn "# Note: logical name 'TERM' may have been created\n";
[EMAIL PROTECTED] %old} = values %old;
+ if (defined \$old_env_dcl_path) {
+ \$ENV{'DCL\$PATH'} = \$old_env_dcl_path;
+ } else {
+ delete \$ENV{'DCL\$PATH'};
+ }
}
EndOfCleanup
}