This is the mail archive of the
mailing list for the Cygwin project.
Missing APPDATA var in env of ssh sessions?
- From: Charles Wilson <cygwin at cwilson dot fastmail dot fm>
- To: Cygwin Mailing List <cygwin at cygwin dot com>
- Date: Wed, 11 Aug 2010 00:23:53 -0400
- Subject: Missing APPDATA var in env of ssh sessions?
The mingw.org folks are developing a new installer, which uses
WININET.dll facilities for d/l support. When I ran the application from
within a cygwin shell, I ended up with the following debris in my
testing /bin dir:
$ ./mingw-get.exe update
%APPDATA%/ libgcc_s_dw2-1.dll mingw-get.exe*
$ find %APPDATA%
Some googling indicates that this stuff is part of the network support
provided by IE8 (or, the bits of Windows' networking that is provided by
the DLLs associated with IE8). index.dat is a database for determining
which domains are TLDs, and is user-customizable. If missing, it
appears the IE8/WININET.dll/SHLWAPI.dll create it automatically.
But the key is, it appears that the culprit, SHLWAPI.dll, checks the
environment for %APPDATA% rather than using the MS-approved mechanism:
0, // Hwnd
strPath, // String buffer.
CSIDL_APPDATA, // CSLID of folder
FALSE ); // Create if doesn't exists?
$ strings /c/Windows/System32/SHLWAPI.dll | grep -i APPDATA
Now, a cmd box has this variable set:
If I start a bash shell within that cmd box:
the variable is still set:
$ echo $APPDATA
The trick is, when I ssh in to the machine (even loopback), I don't have
that env var:
$ ssh localhost
$ echo $APPDATA
Now, this is a minor issue (does "mingw-get" work when invoked from a
cygwin shell as part of a remote session?) However, I expect that the
same flaw -- windows networking DLLs checking for %APPDATA% rather than
using the Win32 API function -- would affect any native networking
program that is launched from a cygwin remote session.
Can ssh (or is it cygwin1.dll?) ensure that the user's APPDATA variable
is populated, since it appears to be a pretty important var for Windows
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple