[PATCH/cygwin] reduce number of propagated environment variables

Roumen Petrov openssh at roumenpetrov.info
Sat Feb 20 08:26:41 EST 2010


Hi Corinna,

Corinna Vinschen wrote:
> Hi,
>
> could somebody apply the below patch, please?  It removes a couple of
> environment variables which are propagated to the child process so far,
> but which not really necessary to keep child processes running.  What's
> left now is the bare minimum which is requested by scripts, typically.
>
>
> Thanks,
> Corinna
>
>
> Index: openbsd-compat/bsd-cygwin_util.c
> ===================================================================
> RCS file: /cvs/openssh/openbsd-compat/bsd-cygwin_util.c,v
> retrieving revision 1.21
> diff -u -p -r1.21 bsd-cygwin_util.c
> --- openbsd-compat/bsd-cygwin_util.c	8 Mar 2009 00:40:28 -0000	1.21
> +++ openbsd-compat/bsd-cygwin_util.c	19 Feb 2010 17:35:28 -0000
> @@ -85,23 +85,14 @@ static struct wenv {
>   	size_t namelen;
>   } wenv_arr[] = {
>   	{ NL("ALLUSERSPROFILE=") },
> -	{ NL("COMMONPROGRAMFILES=") },
>   	{ NL("COMPUTERNAME=") },
>   	{ NL("COMSPEC=") },
>   	{ NL("CYGWIN=") },
> -	{ NL("NUMBER_OF_PROCESSORS=") },
>   	{ NL("OS=") },
>   	{ NL("PATH=") },
>   	{ NL("PATHEXT=") },
> -	{ NL("PROCESSOR_ARCHITECTURE=") },
> -	{ NL("PROCESSOR_IDENTIFIER=") },
> -	{ NL("PROCESSOR_LEVEL=") },
> -	{ NL("PROCESSOR_REVISION=") },
> -	{ NL("PROGRAMFILES=") },
>   	{ NL("SYSTEMDRIVE=") },
>   	{ NL("SYSTEMROOT=") },
> -	{ NL("TMP=") },
> -	{ NL("TEMP=") },
>   	{ NL("WINDIR=") }
>   };
>
>

Why  TMP and TEMP are in the list for removal ?
Some open-source project may use TMP .

What is impact if PROCESSOR_* is removed ? Did you test as example with 
python ?

Roumen


More information about the openssh-unix-dev mailing list