ssh + patch + $TMP

Christopher Faylor cgf-use-the-mailinglist-please@cygwin.com
Thu Feb 18 21:25:00 GMT 2010


On Thu, Feb 18, 2010 at 09:52:02PM +0100, Corinna Vinschen wrote:
>On Feb 18 15:39, Charles Wilson wrote:
>> I ran across an interesting "feature" of remote access today. I was
>> ssh'ed in to my cygwin computer, under my normal windows/cygwin account
>> name, and tried to run 'patch':
>> 
>> $ patch -p1 -R --dry-run < ../some-patch.patch
>> patch: **** Can't create file
>> /c/Users/CYG_SE~1/AppData/Local/Temp/poFOD7WH : Not a directory
>> 
>> $ echo $TMP
>> /c/Users/CYG_SE~1/AppData/Local/Temp
>> 
>> $ echo $TEMP
>> /c/Users/CYG_SE~1/AppData/Local/Temp
>> 
>> $ echo $TMPDIR
>> 
>> 
>> Obviously, my regular user doesn't have access to cyg_server's AppData
>> directory. This is easily fixed, of course, by setting $TMP=/tmp (or
>> /c/Users/<me>/AppData/Local/Temp, if you like).  The question is, should
>> this be something that is done by default in /etc/profile (e.g. part of
>> the base-files package)?
>
>In contrast to other systems, sshd for Cygwin preserves a couple of
>environment variables from the parent sshd process running under the
>cyg_server account.  The list of preserved variables is:
>
>  ALLUSERSPROFILE
>  COMMONPROGRAMFILES
>  COMPUTERNAME
>  COMSPEC
>  CYGWIN
>  NUMBER_OF_PROCESSORS
>  OS
>  PATH
>  PATHEXT
>  PROCESSOR_ARCHITECTURE
>  PROCESSOR_IDENTIFIER
>  PROCESSOR_LEVEL
>  PROCESSOR_REVISION
>  PROGRAMFILES
>  SYSTEMDRIVE
>  SYSTEMROOT
>  TMP
>  TEMP
>  WINDIR
>
>Is it time to reduce this list?  Should sshd remove TMP and TEMP?
>Anything else?

I'd say that it should only preserve COMSPEC, CYGWIN, SYSTEMDRIVE,
SYSTEMROOT, WINDIR, and, I guess, PATH.  The other stuff is pretty
useless anyway.  You can't reliably depend on, e.g., PROCESSOR_REVISION
environment variable to be accurate any more than you can rely on email
that says "Certified spam free" to be spam free.

I hate to see the environment polluted this way but, then, linux does
it too.

cgf

--
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



More information about the Cygwin mailing list