Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Message-ID: <003a01bfeef3$83f81340$50241004@homepc.freedsl.com>
Reply-To: "Dave Arnold" <avr_fan@mailandnews.com>
From: "Dave Arnold" <avr_fan@nettaxi.com>
To: "Mark Weaver" <mark@npsl.co.uk>, "Cygwin" <cygwin@sourceware.cygnus.com>
Subject: Re: environ problem
Date: Sat, 15 Jul 2000 23:50:35 -0700
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3

I don't know a darn thing about POSIX but I do know that I tried using
getenv() and also had access violations and other similar hangups.

Do these functions work at all with cygwin?

/dave

-----Original Message-----
From: Mark Weaver <mark@npsl.co.uk>
To: Cygwin <cygwin@sourceware.cygnus.com>
Date: Monday, July 10, 2000 8:12 AM
Subject: environ problem


>I am currently in the process of a sendmail port to NT, based on cygwin.  I
>have discovered that sendmail internally modifies environ, and then uses
>putenv to modify the resulting environment (sample code that I abstracted
>attached below) - doing this causes cygwin compiled programs to crash (due
>in fact to an overwrite of the import address table).  (The crash might not
>be immediate; a number of putenv calls are sometimes required for the
>appropriate chunk of memory to be overwritten).
>
>Before I `fix' this behaviour, does POSIX allow for modifying environ?  And
>even if it doesn't, then is the practice widespread enough for it to be
>worth supporting?  (i.e. should I fix cygwin or sendmail!)
>
>Thanks,
>
>Mark
>
>code snippet:
>
>int main()
>{
> char *emptyenviron[1];
> char** ExternalEnviron;
>
> emptyenviron[0] = NULL;
> ExternalEnviron = environ;
> environ = emptyenviron;
>
> putenv("AGENT=sendmail"); // access violation here
> return 1;
>}
>
>
>--
>Want to unsubscribe from this list?
>Send a message to cygwin-unsubscribe@sourceware.cygnus.com
>


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

