delorie.com/archives/browse.cgi | search |
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 |
Message-ID: | <003c01bfeef8$f17574d0$f7c723cb@lifelesswks> |
From: | "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au> |
To: | "Dave Arnold" <avr_fan AT mailandnews DOT com>, "Mark Weaver" <mark AT npsl DOT co DOT uk>, |
"Cygwin" <cygwin AT sourceware DOT cygnus DOT com> | |
References: | <003a01bfeef3$83f81340$50241004 AT homepc DOT freedsl DOT com> |
Subject: | Re: environ problem |
Date: | Sun, 16 Jul 2000 17:38:54 +1000 |
MIME-Version: | 1.0 |
X-Priority: | 3 |
X-MSMail-Priority: | Normal |
X-Mailer: | Microsoft Outlook Express 5.00.2919.6700 |
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2919.6700 |
AFAIK, putenv is _meant_ to alter the local environment.. http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC8 Rob ----- Original Message ----- From: "Dave Arnold" <avr_fan AT nettaxi DOT com> To: "Mark Weaver" <mark AT npsl DOT co DOT uk>; "Cygwin" <cygwin AT sourceware DOT cygnus DOT com> Sent: Sunday, July 16, 2000 4:50 PM Subject: Re: environ problem > 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 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 > > -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |