X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-6.8 required=5.0	tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4C59BA9F.8050505@redhat.com>
Date: Wed, 04 Aug 2010 13:08:15 -0600
From: Eric Blake <eblake@redhat.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.1.1
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: incompatible environment variable names
References: <AANLkTi=W1mfktf7Nri6B=fYPHTxwSqa-6O3tDuQL6KnU@mail.gmail.com> <2BF01EB27B56CC478AD6E5A0A28931F20130250E@A1DAL1SWPES19MB.ams.acs-inc.net>
In-Reply-To: <2BF01EB27B56CC478AD6E5A0A28931F20130250E@A1DAL1SWPES19MB.ams.acs-inc.net>
Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig20AEAC9C5765AF6C7B9EE499"
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

--------------enig20AEAC9C5765AF6C7B9EE499
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 08/04/2010 12:59 PM, Nellis, Kenneth wrote:
>> From: Steven Collins
>> On Wed, Aug 4, 2010 at 10:23, Nellis, Kenneth wrote:
>>> I came across an interesting (IMHO) incompatibility between
>>> Windows and bash environment variable names.

Not just windows, but any system with environment variables.

Anyone can call execve and set arbitrary strings in the environment that
do not correspond to valid environment variables in the shell.  Bash can
inherit such invalid names, at which point, POSIX says that bash may,
but not must, preserve those invalid names to pass on to children, even
though they cannot be accessed from within the shell itself.

>=20
> Well, *somehow* it got into the Cygwin environment, and cygwin.bat direct=
ly
> invokes bash, so I interpret this as bash creating the Cygwin environment.
> Where is the hole in this logic?

Bash does not create the cygwin environment.  Rather, it inherits the
environment from the parent process.

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig20AEAC9C5765AF6C7B9EE499
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJMWbqfAAoJEKeha0olJ0NqlysIAISyhBQ7I6kVhooe6H4wV2QT
cqPrYIbpWx4BKHTTRVmU7d4G+DbZmnmhmOUqNntnsq4VWKVEpAEyohRZN7FpZWqE
NaTgDacevw9fpXryg5pdqOAVdhiR4q+UbBP9FQyXj/wUJZkZR0BSBYAep2wxR8wE
0Syjxm3/OFSZtC4xcSL13Iu+oEqGcTPhwdpUH3LluvmRgp7rfYpZXChN7MSy3Kfc
YDKWkEWSzCZkRxSWNvf0HbhxtLmvtCtaX1BoTTun97lBNmhOXs/o5WyLtF47IOWj
OeVdTdP6+TorgPlGzdz4/inXxEzXiqoQmeX/DOQdMT8A6eCYfLvEaFET3Lqgl94=
=E6cW
-----END PGP SIGNATURE-----

--------------enig20AEAC9C5765AF6C7B9EE499--
