Enviroment always uppercased; Help me, please

Markus K. E. Kommant Markus.Kommant@de.adp.com
Fri Mar 1 05:06:00 GMT 2002


Idea:

It would be better to support an evironment variable CYGWIN_ENV_UPPERCASE=0,
1, 2 or a list "var1 var2 var3".
The list could be, to work correctly in most cases (I used in my pdksh port)
"SHELL", "EXECSHELL", "PATH", "HOME", "INCLUDE", "LIB", "HOMEPATH",
"PATHEXT", "TMP", "TMPDIR", "TEMP", "WINDIR", "SYSTEMDRIVE", "COMSPEC",
"HOMEDRIVE", "HOMESHARE", "COMPUTERNAME", "SYSTEMROOT", "LD_LIBRARY_PATH",
NULL,

CYGWIN_ENV_UPPERCASE=1 or not set = the current situation
CYGWIN_ENV_UPPERCASE=0, do not change anything
CYGWIN_ENV_UPPERCASE=2, use default uppercase list (see above)
CYGWIN_ENV_UPPERCASE="var1 var2 var3 var4" uppercase only this variables.


The problem is the following function inside environ.cc. 
/* Turn environment variable part of a=b string into uppercase. */
static __inline__ void ucenv (char *p, char *eq)
{
  /* Amazingly, NT has a case sensitive environment name list,
(...)

The function simplifies to uppercase ALL environment variables.
And the next point is, that the environment is sorted (the bash will sort
the environment).
That means, that a lowercase variable (early in environment) will overwrite
an uppercase variable. Is it wanted? The environment has to be "cleaned up"
vice-versa?!?

But the (biggest) problem is, that the amazing case-sensitiv NT environment
will be changed, when
    if (!myself->ppid_handle) ucenv (newp, eq);
And this does'nt make any sense to me. Every "tiny" none cygwin program is a
danger for the current environment.

The following bash command sequence will destroy the bash environment. 
This is an example! I know how to call the bash, and that this example could
be solved by "bash -c bash" (nice)... I am working with some more other
programs, nobody will know. The example demonstrates the basic problem.


$ cmd.exe /C bash.exe

$ export path=laughing
$ export PATH="/usr/bin"
$ cmd.exe /C bash.exe
$ echo $PATH
laughing


> No idea what this question is.  Are you saying that you want 
> a cygwin for the POSIX subsystem?  There is no reason for such a thing.
No.
But the FAQ for cygwin says:
>The Cygwin tools are ports of the popular GNU development tools for
Microsoft Windows. They run thanks >to the Cygwin library which provides the
UNIX system calls and environment these programs expect. 

Such things, as I described ar not happening on UNIX, and they doesn't
happen, when not brute force changing the environment by uppercase all and
everyting (in the wrong order).

The biggest problem, I can not switch it off.

best regards
   Markus 


> -----Original Message-----
> From: Christopher Faylor [mailto:cygwin@cygwin.com]
> Sent: Thursday, February 28, 2002 3:22 PM
> To: cygwin@cygwin.com
> Subject: Re: Enviroment always uppercased; Help me, please
> 
> 
> On Thu, Feb 28, 2002 at 03:16:47PM +0100, Markus K. E. Kommant wrote:
> >Really???
> >
> >> Don't start the program from a non cygwin program.
> >
> >I am using Windows 2000/NT operating system as the base for my cygwin
> >programs and not DOS and not Linux.
> 
> Huh?
> 
> >Do anyone know a good trick to use POSIX Environment (or 
> simply real Windows
> >Environment) without the cygwin-DOS changes.
> 
> c:\> c:\cygwin\bin\sh -c "myprog.exe arg1 arg2"
> 
> I really don't know what you're talking about wrt cygwin-DOS.
> 
> >Hopefully waiting for help, without real POSIX I have to 
> look for another
> >programming base, instead of cygwin... 
> >
> >Probably there has anybody build an own cygwin1.dll with 
> POSIX Environment
> >on Windows???
> 
> No idea what this question is.  Are you saying that you want 
> a cygwin for
> the POSIX subsystem?  There is no reason for such a thing.
> 
> cgf
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list