This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Missing APPDATA var in env of ssh sessions?

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

$ pwd

$ ls
libgcc_s_dw2-1.dll  mingw-get.exe*

$ ./mingw-get.exe update

$ ls
%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:
C:\Users\me>echo %APPDATA%

If I start a bash shell within that cmd box:

C:\Users\me>c:\cygwin-1.7\bin\bash --login

the variable is still set:

me@computer[1.7] ~
$ 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:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]