X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 	tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <23881903.1595996.1268073848982.JavaMail.fmail@mwmweb034>
Date: Mon, 8 Mar 2010 19:44:08 +0100 (CET)
From: Kurt Franke <Kurt-Franke@web.de>
MIME-Version: 1.0
To: cygwin@cygwin.com, Cyrille Lefevre <cyrille.lefevre-lists@laposte.net>
Subject: Re: ssh + patch + $TMP
References: <1266525566.7752.1360709921@webmail.messagingengine.com>  <loom.20100219T220113-236@post.gmane.org> <4B806ACA.2030409@laposte.net>  <loom.20100222T212522-331@post.gmane.org>, <4B92D7A1.7010603@laposte.net>
In-Reply-To: <4B92D7A1.7010603@laposte.net>
X-UI-Message-Type: mail
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Sensitivity: Normal
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

-----Urspr=C3=BCngliche Nachricht-----
Von: Cyrille Lefevre <cyrille.lefevre-lists@laposte.net>
Gesendet: 06.03.2010 23:30:57
An: cygwin@cygwin.com,Kurt-Franke@web.de
Betreff: Re: ssh + patch + $TMP

>Hi,
>
>the attached script only fork 5 processes (ps, grep, mount, find and=20
>awk), and does not use any temporary files, so, it should not degrade=20
>ssh logins performance.
>existing environment variables are not overwritten.
>
>Regards,
>
>Cyrille Lefevre

Hi,

it won't work this way.
a script in /etc/profile.d is sourced like the profile script itself to tak=
e effect
in the environment of the actual shell.
every program called in such a script as subprocess must create an output f=
ile
to be sourced also from within this script to get the settings in the actua=
l shell.

thus you must write the environment settings build in awk script from regis=
try to=20
a file and source it at shell level after awk script has finished.

and, of course, not all all existing environment variables should be preser=
ved.
in the special those with bad values must get a correct value.
for example TMP and TEMP have invalid values after a logon via sshd - they =
are set
to the value used by the user which is running the sshd and to the value of
the actual user.
if running with a windows version less 6.0 in a sshd session USERNAME and U=
SERDOMAIN
have the values belonging to the SYSTEM user and not the values of the actu=
al user.
may be some others have also invalid values.
I think it is better to preserve a known list of variables and overwrite al=
l others.

regards

kf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

