develooper Front page | perl.perl5.porters | Postings from October 2005

[perl #36665] delete $ENV{FOO} leaves $FOO visible in subprocesses on Cygwin Perl

From:
Steve Peters via RT
Date:
October 11, 2005 10:11
Subject:
[perl #36665] delete $ENV{FOO} leaves $FOO visible in subprocesses on Cygwin Perl
Message ID:
rt-3.0.11-36665-122640.9.71813352919938@perl.org
> [andrew@tellme.com - Wed Jul 27 00:47:52 2005]:
> 
> This is a bug report for perl from andrew@tellme.com,
> generated with the help of perlbug 1.35 running under perl v5.8.7.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> For at least Perl 5.8.7 on Cygwin, delete()ing an environment variable
> does not apparently remove that variable from the environment of a
> subprocess. Here is a short repro case:
> 
>      #!/usr/bin/perl
>      use strict;
>      use warnings;
> 
>      $ENV{SHOULD_NEVER_BE_SEEN} = "hello world";
>      delete($ENV{SHOULD_NEVER_BE_SEEN});
>      system("printenv | grep SHOULD_NEVER_BE_SEEN");
> 
> On Unix systems this script appropriately prints nothing.
> On an up to date Cygwin installation this prints "hello world".
> 
> This bug manifested itself as a problem with Test::Harness on Cygwin
> Perl. For context, see the e-mail thread around this summary message:
> http://cygwin.com/ml/cygwin/2005-07/msg01201.html
> 

The problem was with Perl's handling of environment variables when Perl 
is compiled with -DPERL_USE_SAFE_PUTENV.  This has been fixed, though, 
in bleadperl with change #25737.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About