delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/07/17/12:34:26

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Mon, 17 Jul 2000 12:33:13 -0400
To: cygwin AT sources DOT redhat DOT com
Subject: Re: environ problem
Message-ID: <20000717123313.N3902@cygnus.com>
Reply-To: cygwin AT sources DOT redhat DOT com
Mail-Followup-To: cygwin AT sources DOT redhat DOT com
References: <20000716115413 DOT C11176 AT cygnus DOT com> <NEBBKFHFBJHCNOJOHEIEMECACBAA DOT mark AT npsl DOT co DOT uk>
Mime-Version: 1.0
User-Agent: Mutt/1.2i
In-Reply-To: <NEBBKFHFBJHCNOJOHEIEMECACBAA.mark@npsl.co.uk>; from mark@npsl.co.uk on Mon, Jul 17, 2000 at 11:54:52AM +0100

On Mon, Jul 17, 2000 at 11:54:52AM +0100, Mark Weaver wrote:
>I agree that it's an exceedingly weird thing to do, and I wouldn't have
>expected it to work, and I'm quite happy that putenv/getenv are supported
>under normal circumstances.
>However, the fact that a well established piece of software that runs on a
>number of different architectures uses code like this gives me a suspicion
>that it should work.  So my question is - where is the problem?  Sendmail
>doing something naughty or cygwin not supporting something it should?

I don't know.

cgf

>-----Original Message-----
>From: cygwin-owner AT sources DOT redhat DOT com
>[mailto:cygwin-owner AT sources DOT redhat DOT com]On Behalf Of Chris Faylor
>Sent: Sunday, July 16, 2000 4:54 PM
>To: Cygwin
>Subject: Re: environ problem
>
>
>On Sat, Jul 15, 2000 at 11:50:35PM -0700, Dave Arnold wrote:
>>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?
>
>They are supposed to work.  Do you honestly think that we'd release code
>that intentionally gives access violations?
>
>Or, if you think that the environ stuff is trivially broken, then how
>do you suppose the various shells manage to manipulate their environment?
>
>If you have test cases that illustrate breakage in getenv/putenv then
>please post them and we'll make it a top priority to fix this problem,
>assuming that you're not doing something like the below which tries
>to do something exceedingly weird with the environ pointer.
>
>cgf
>
>>-----Original Message-----
>>From: Mark Weaver <mark AT npsl DOT co DOT uk>
>>To: Cygwin <cygwin AT sourceware DOT cygnus DOT 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 AT sourceware DOT cygnus DOT com
>
>
>--
>Want to unsubscribe from this list?
>Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

-- 
cgf AT cygnus DOT com                        Cygnus Solutions, a Red Hat company
http://sourceware.cygnus.com/         http://www.redhat.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019