From: aubrey@eden.com ("Aubrey McAuley")
Subject: env bug
24 Jan 1997 19:35:53 -0800
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <199701241849.MAA14251.cygnus.gnu-win32@natashya.eden.com>
Reply-To: aubrey@eden.com
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7BIT
Comments: Authenticated sender is <aubrey@[199.171.21.14]>
Original-To: gnu-win32@cygnus.com
X-mailer: Pegasus Mail for Win32 (v2.52)
Original-Sender: owner-gnu-win32@cygnus.com

We are in the midst of porting a large collection of CGIs to NT and 
have found the gnu-win32 b17 utilities very helpful. However, some 
nagging problems with environment variables are causing us major 
headaches.

First, env.exe does not work as advertised. Specifically, it 
appears to be missing the full fuunctionality it has in UNIX, i.e. 

env [ option ]... [ name=value ]... [ command [ args ]... ]

using env to report environment settings works fine. Setting several 
name=value pairs also seems to work fine except that those settings 
are not acually maintained when [ command [ args ]... ] is executed. 
neither are they maintained for any further commands or programs 
executed. For example, assume your current environment looks like:

FOO=garbage
BAR=cleanup

and you run a simple script like this to show the environment, modify 
a few settings, and then display them:

env ; env FOO=testing BAR=this env

In UNIX, this would produce something like

FOO=garbage
BAR=cleanup

FOO=testing
BAR=this

Under gnu-win32 bash this does not work and will return

FOO=garbage
BAR=cleanup

FOO=garbage
BAR=cleanup

The strange thing about this is that export works correctly, so that 
a modified script like:

env ; export FOO=testing ; export BAR=this ; env

will produce the correct results.

It appears that the problem is not limited env.exe but is a much 
deeper bug that may be related to problems in popen(). We have 
several CGIs that use popen() and setenv(), but under NT gnu-win32 
these functions do not appear to work correctly, meaning that we 
cannot spawn external processes that have an environment different 
from the parent.

Are we missing something simple? Has anyone else encountered this 
problem? Any help would be greatly appreciated.






  Aubrey McAuley <aubrey@eden.com>                  ---- Fineep ----
/---------------------------------------------------------------------\
| The Eden Matrix Online Service                Adhesive Media, Inc.  |
| Web URL   http://www.eden.com      101 W.6th,#210, Austin, TX 78701 |
| voice: 512-478-9900, x201                     dialup: 512-478-9963  |
\---------------------------------------------------------------------/
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
