Subject: Cygdrive prefix in $PATH under ssh login?
From: "Lassi A. Tuura" <[email-masked]>
To: [email-masked]
Date: Mon, 01 Oct 2001 13:20:30 +0200

Hi there,

I have updated to the latest cygwin on my W2K system.  As far as I can
tell everything works very well and I am very happy with cygwin (since
the B18 days).

I have a small problem in my remote login setup and would appreciate any
help anybody can offer.  I haven't found an answer in the documentation,
faq, or google, but if missed something, please point me to it.  I did
try to follow the instructions in the various *.READMEs, but I must have
managed to do something goofy while playing around.

My problem is that under ssh remote login (only) $PATH uses the wrong
cygdrive prefix.  All my mounts should be system-wide and the
system-wide cygdrive prefix is '/'.  However under ssh login, $PATH
still has /cygdrive/<drive> in it for all elements inherited from the
Windows system environment.  On the other hand, under the same remote
session `mount' reports what I expect.  Similarly, bash fails to run
many commands (solved by sedding the the /cygdrive prefix out from
$PATH).  So most of the environment is consistent with my expectations,
but something is inconsistent at the time $PATH is copied to the cygwin
processes.

I assume this is because somehow the sshd service is inheriting wrong
setting from somewhere, but I have failed to find a way to correct this
problem (presumably an error of mine somewhere!).

Here are the details:
 - Running W2K under VMware (cygcheck -s -v -r attached)
 - Did iu-config, sshd-config as per docs; sshd starts via
   service of its own, not via inetd
 - Windows says inetd and sshd have started fine
 - Domain account; /etc/passwd and /etc/group ok
 - Everything works fine locally
 - Remote login (ssh) and ftp works fine
 - Windows system environment has:
    - $CYGWIN set to `binmode ntsec tty'
    - $PATH has cygwin bin directory first in it
 - /etc/profile is almost unchanged (I changed the prompt)
 - I have no .bashrc in my home directory (/home/lat) so
   I should get the default bash environment
 - This is after W2K reboot after last changes to service
   setups and anything that should affect the environment
   (env vars, mounts, ...) in any way

I can fix this by overriding $PATH in my shell setup, so this isn't
fatal.  But I would like to inherit the Windows environment for defaults
if possible.  For now I can add a little sedding to fix the $PATH in the
login environment, but I'd rather avoid this long term.

I've attached two outputs, first (local.txt) from `echo $PATH' and then
from `ssh localhost echo \$PATH' (remote.txt).  Mount says:

$ mount 
C:\Users\Lassi\Cygwin\bin on /usr/bin type system (binmode)
C:\Users\Lassi\Cygwin\lib on /usr/lib type system (binmode)
C:\Users\Lassi\Cygwin on / type system (binmode)
c: on /c type user (textmode,noumount)
o: on /o type user (textmode,noumount)

$ mount -p
Prefix              Type         Flags
/                   user         textmode
/                   system       textmode

This is from a running ssh remote session (no different in the local
session).  It seems that only my $PATH is wrong, everything else seems
right :-/

Any help would be greatly appreaciated,
//lat
-- 
Be true in all words and actions; and unnecessarily
deliver not your opinion, but when you do, let it be
just, and considered, and plain.  --Ann Fanshawe

Cygnus Win95/NT Configuration Diagnostics
Current System Time: Mon Oct  1 12:15:29 2001

WinNT Ver 5.0 build 2195 Service Pack 1

Path:	/usr/local/bin
	/usr/bin
	/bin
	/c/WINNT/MS/SMS/CORE/BIN
	/usr/bin
	/o/Oracle/Rdbms8i/bin
	/c/Program Files/Perl/bin/
	/c/WINNT/system32
	/c/WINNT
	/c/WINNT/System32/Wbem
	/c/Program Files/Resource Kit/
	/o/Oracle/Wininst/jre/1.1.7/bin
	/o/Oracle/DesDev/bin
	/c/WINNT/System32/
	/c/WINNT/
	/c/WINNT/System32/Wbem
	/o/Oracle/DesDev/jdk/bin
	/c/Program Files/Microsoft Visual Studio/Common/Tools/WinNT
	/c/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin
	/c/Program Files/Microsoft Visual Studio/Common/Tools
	/c/Program Files/Microsoft Visual Studio/VC98/bin

SysDir: C:\WINNT\System32
WinDir: C:\WINNT

PWD = `/home/lat'
CYGWIN = `ntsec tty binmode'
USER = `lat'
MAKE_MODE = `unix'
HOME = `/home/lat'

NUMBER_OF_PROCESSORS = `1'
PROMPT = `$P$G'
LOGONSERVER = `\\CERNDC01'
OS2LIBPATH = `C:\WINNT\system32\os2\dll;'
COMSPEC = `C:\WINNT\system32\cmd.exe'
!C: = `C:\Users\Lassi\Cygwin\bin'
SYSTEMDRIVE = `C:'
HOSTNAME = `LXCMS57'
INCLUDE = `C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Microsoft Visual Studio\VC98\include'
PROCESSOR_REVISION = `0703'
MSDEVDIR = `C:\Program Files\Microsoft Visual Studio\Common\MSDev98'
PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
COMPUTERNAME = `LXCMS57'
CLASSPATH = `C:\WINNT\System32\QTJava.zip'
WINDIR = `C:\WINNT'
USERPROFILE = `C:\Documents and Settings\lat'
PS1 = `$ '
PROGRAMFILES = `C:\Program Files'
QTJAVA = `C:\WINNT\System32\QTJava.zip'
USERDNSDOMAIN = `cern.ch'
!:: = `::\'
MACHTYPE = `i686-pc-cygwin'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 7 Stepping 3, GenuineIntel'
OS = `Windows_NT'
OLDPWD = `/usr/bin'
PROCESSOR_ARCHITECTURE = `x86'
TEMP = `/c/DOCUME~1/lat/LOCALS~1/Temp'
PROCESSOR_LEVEL = `6'
SYSTEMROOT = `C:\WINNT'
HOMEDRIVE = `C:'
LIB = `C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio\VC98\lib'
ALLUSERSPROFILE = `C:\Documents and Settings\All Users'
SHLVL = `1'
APPDATA = `C:\Documents and Settings\lat\Application Data'
COMMONPROGRAMFILES = `C:\Program Files\Common Files'
HOMEPATH = `\'
USERDOMAIN = `CERN'
USERNAME = `lat'
SHELL = `/bin/bash'
HOSTTYPE = `i686'
WF_RESOURCES = `O:\Oracle\Rdbms8i\WF\RES\WFUS.RES'
OSTYPE = `cygwin'
TERM = `cygwin'
SMS_LOCAL_DIR = `C:\WINNT'
_ = `/usr/bin/cygcheck'
TZ = `WEST-1WEDT-2,M3.5.0/2,M10.5.0/3'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/'
  cygdrive flags = 0x00000020
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs\Cygnus Solutions
  (default) = (unsupported type)
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/'
  cygdrive flags = 0x00000028
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = `C:\Users\Lassi\Cygwin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
  (default) = `C:/Users/Lassi/Cygwin/bin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
  (default) = `C:/Users/Lassi/Cygwin/lib'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options

a:  fd           N/A    N/A                    
c:  hd  NTFS    3741Mb  90% CP CS UN PA FC     Windows
d:  cd           N/A    N/A                    
o:  net NTFS   140010Mb  81% CP CS UN PA FC     CERNSOFT01

C:\Users\Lassi\Cygwin\bin  /usr/bin  system  binmode
C:\Users\Lassi\Cygwin\lib  /usr/lib  system  binmode
C:\Users\Lassi\Cygwin  /        system  binmode
c:    /c       user    textmode,noumount
o:    /o       user    textmode,noumount

Found: C:\Users\Lassi\Cygwin\bin\bash.exe
Found: C:\Users\Lassi\Cygwin\bin\cat.exe
Found: C:\Users\Lassi\Cygwin\bin\cpp.exe
Found: C:\Users\Lassi\Cygwin\bin\find.exe
Found: C:\Users\Lassi\Cygwin\bin\gcc.exe
Found: C:\Users\Lassi\Cygwin\bin\gdb.exe
Found: C:\Users\Lassi\Cygwin\bin\ld.exe
Found: C:\Users\Lassi\Cygwin\bin\ls.exe
Found: C:\Users\Lassi\Cygwin\bin\make.exe
Found: C:\Users\Lassi\Cygwin\bin\sh.exe

   56k 2000/12/03 C:\Users\Lassi\Cygwin\bin\cygbz21.0.dll - os=4.0 img=1.0 sys=4.0
                  "cygbz21.0.dll" v0.0 ts=2000/11/21 0:53
   45k 2001/04/25 C:\Users\Lassi\Cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0
                  "cygform5.dll" v0.0 ts=2001/4/25 7:28
   18k 2000/10/23 C:\Users\Lassi\Cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm.dll" v0.0 ts=2000/10/23 4:26
   17k 2001/06/28 C:\Users\Lassi\Cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory4.dll" v0.0 ts=2001/1/7 5:34
   21k 2001/06/28 C:\Users\Lassi\Cygwin\bin\cyghistory5.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory5.dll" v0.0 ts=2001/6/28 4:27
   21k 2001/06/20 C:\Users\Lassi\Cygwin\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl.dll" v0.0 ts=2001/6/20 19:09
   81k 2001/04/28 C:\Users\Lassi\Cygwin\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitcl30.dll" v0.0 ts=2001/4/29 0:57
   35k 2001/04/28 C:\Users\Lassi\Cygwin\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitk30.dll" v0.0 ts=2001/4/29 0:57
   45k 2001/07/04 C:\Users\Lassi\Cygwin\bin\cygjbig1.dll - os=4.0 img=1.0 sys=4.0
                  "cygjbig1.dll" v0.0 ts=2001/7/4 5:25
  119k 2001/06/06 C:\Users\Lassi\Cygwin\bin\cygjpeg6b.dll - os=4.0 img=1.0 sys=4.0
                  "cygjpeg6b.dll" v0.0 ts=2001/6/6 6:27
   26k 2001/04/25 C:\Users\Lassi\Cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu5.dll" v0.0 ts=2001/4/25 7:27
  156k 2001/04/25 C:\Users\Lassi\Cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++5.dll" v0.0 ts=2001/4/25 7:29
  226k 2001/04/25 C:\Users\Lassi\Cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses5.dll" v0.0 ts=2001/4/25 7:17
   15k 2001/04/25 C:\Users\Lassi\Cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel5.dll" v0.0 ts=2001/4/25 7:27
  163k 2001/05/06 C:\Users\Lassi\Cygwin\bin\cygpng2.dll - os=4.0 img=1.0 sys=4.0
                  "cygpng2.dll" v0.0 ts=2001/5/6 6:05
  108k 2001/06/28 C:\Users\Lassi\Cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline4.dll" v0.0 ts=2001/1/7 5:34
  135k 2001/06/28 C:\Users\Lassi\Cygwin\bin\cygreadline5.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline5.dll" v0.0 ts=2001/6/28 4:27
  390k 2001/04/28 C:\Users\Lassi\Cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtcl80.dll" v0.0 ts=2001/4/29 0:56
    5k 2001/04/28 C:\Users\Lassi\Cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0
   10k 2001/04/28 C:\Users\Lassi\Cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtclreg80.dll" v0.0 ts=2001/4/29 0:56
  245k 2001/06/12 C:\Users\Lassi\Cygwin\bin\cygtiff3.dll - os=4.0 img=1.0 sys=4.0
                  "cygtiff3.dll" v0.0 ts=2001/6/12 19:25
  623k 2001/04/28 C:\Users\Lassi\Cygwin\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtk80.dll" v0.0 ts=2001/4/29 0:57
   41k 2001/07/04 C:\Users\Lassi\Cygwin\bin\cygXpm-noX4.dll - os=4.0 img=1.0 sys=4.0
                  "cygXpm-noX4.dll" v0.0 ts=2001/7/4 3:21
   45k 2001/07/04 C:\Users\Lassi\Cygwin\bin\cygXpm-X4.dll - os=4.0 img=1.0 sys=4.0
                  "cygXpm-X4.dll" v0.0 ts=2000/11/20 3:45
   49k 2001/02/03 C:\Users\Lassi\Cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
                  "cygz.dll" v0.0 ts=2001/2/3 21:35
  701k 2001/09/13 C:\Users\Lassi\Cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2001/9/13 5:54
    Cygwin DLL version info:
        dll major: 1003
        dll minor: 3
        dll epoch: 19
        dll bad signal mask: 19005
        dll old termios: 5
        dll malloc env: 28
        api major: 0
        api minor: 46
        shared data: 3
        dll identifier: cygwin1
        mount registry: 2
        cygnus registry name: Cygnus Solutions
        cygwin registry name: Cygwin
        program options name: Program Options
        cygwin mount registry name: mounts v2
        cygdrive flags: cygdrive flags
        cygdrive prefix: cygdrive prefix
        cygdrive default prefix: 
        build date: Wed Sep 12 23:54:31 EDT 2001
        shared id: cygwin1S3

Use -h to see help about each section
/usr/local/bin:/usr/bin:/bin:/c/WINNT/MS/SMS/CORE/BIN:/usr/bin:/o/Oracle/Rdbms8i/bin:/c/Program Files/Perl/bin/:/c/WINNT/system32:/c/WINNT:/c/WINNT/System32/Wbem:/c/Program Files/Resource Kit/:/o/Oracle/Wininst/jre/1.1.7/bin:/o/Oracle/DesDev/bin:/c/WINNT/System32/:/c/WINNT/:/c/WINNT/System32/Wbem:/o/Oracle/DesDev/jdk/bin:/c/Program Files/Microsoft Visual Studio/Common/Tools/WinNT:/c/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin:/c/Program Files/Microsoft Visual Studio/Common/Tools:/c/Program Files/Microsoft Visual Studio/VC98/bin
/usr/bin:/cygdrive/o/Oracle/Rdbms8i/bin:/cygdrive/c/Program Files/Perl/bin/:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:/cygdrive/c/WINNT/System32/Wbem:/cygdrive/c/Program Files/Resource Kit/:/cygdrive/o/Oracle/Wininst/jre/1.1.7/bin:/cygdrive/o/Oracle/DesDev/bin:/cygdrive/c/WINNT/System32/:/cygdrive/c/WINNT/:/cygdrive/c/WINNT/System32/Wbem:/cygdrive/o/Oracle/DesDev/jdk/bin:/bin

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/