delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/02/18/15:52:18

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 18 Feb 2010 21:52:02 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: ssh + patch + $TMP
Message-ID: <20100218205202.GY5683@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <1266525566 DOT 7752 DOT 1360709921 AT webmail DOT messagingengine DOT com>
MIME-Version: 1.0
In-Reply-To: <1266525566.7752.1360709921@webmail.messagingengine.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019