Subject: 1.3.2 chroot bug (NT 4.0 and W2K)
From: Peter Keller <[email-masked]>
To: <[email-masked]>
Date: Wed, 11 Jul 2001 10:28:46 +0100 (GMT Daylight Time)

Hi,

I have hit a problem with the 'chroot' system call in cygwin 1.3.2. This
can be seen with the 'chroot' shell utility:

$ chroot /home
chroot: cannot chdir to root directory: No such file or directory

A little more investigation with a simple C program that calls 'chroot'
shows that the system call 'chroot' returns 0 (success) when the path
argument points to a real directory. After the chroot call, getwd returns
the current path with respect to the new root OK. However, chdir and stat
set errno to ENOENT for any path (including "/"), whether the path is with
respect to the old or new root. statfs works OK after the chroot call.

I came across this problem when trying to set up an anonymous ftp server:
this bug forces me to set the home directory for the ftp account to "/":
not exactly the best choice :-)

I have tried this on both NT and W2K: below are the cygcheck outputs for
both.

This problem was pointed out by Symeon Noon on 24 May 2001, but he informs
me that no-one responded to his mail.

Regards,
Peter.

---------------------- NT configuration -----------------------

Cygnus Win95/NT Configuration Diagnostics
Current System Time: Tue Jul 10 20:32:18 2001

WinNT Ver 4.0 build 1381 Service Pack 5

Path:	/usr/local/bin
	/usr/bin
	/bin
	/cygdrive/d/ORANT/bin
	/cygdrive/d/ORA8ISERVER/bin
	/cygdrive/c/Program Files/Oracle/jre/1.1.7/bin
	/cygdrive/d/ORADES6I/bin
	/cygdrive/d/ORANT/ots/bin
	/cygdrive/d/ORANT/ows/4.0/bin
	/cygdrive/d/ORANT/orb/ADMIN/CGI
	/cygdrive/d/ORANT/orb/BIN
	/cygdrive/c/WINNT/system32
	/cygdrive/c/WINNT
	/cygdrive/d/ORANT/jdk/bin
	/cygdrive/d/ORA8ISERVER/orb/bin

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

PWD = `/home/Administrator'
USER = `Administrator'
MAKE_MODE = `unix'
HOME = `/home/Administrator'

NUMBER_OF_PROCESSORS = `1'
PROMPT = `$P$G'
LOGONSERVER = `\\MSD-PC'
OS2LIBPATH = `C:\WINNT\system32\os2\dll;'
COMSPEC = `C:\WINNT\system32\cmd.exe'
!C: = `C:\WINNT\Profiles\Administrator\Desktop'
SYSTEMDRIVE = `C:'
HOSTNAME = `MSD-PC'
PROCESSOR_REVISION = `0502'
!D: = `D:\cygwin\bin'
PATHEXT = `.COM;.EXE;.BAT;.CMD'
COMPUTERNAME = `MSD-PC'
CLASSPATH = `D:\ORANT\ots\classes\jts805jdbc.jar;D:\ORANT\ots\classes\oraclejts.jar;D:\ORANT\ows\4.0\classes\wrbjidl.jar;'
WINDIR = `C:\WINNT'
USERPROFILE = `C:\WINNT\Profiles\Administrator'
PS1 = `\[\033]0;\w\007
\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$ '
MACHTYPE = `i686-pc-cygwin'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 5 Stepping 2, GenuineIntel'
WIN32DMIPATH = `C:\DMI\'
OS = `Windows_NT'
OLDPWD = `/usr/bin'
PROCESSOR_ARCHITECTURE = `x86'
TEMP = `/cygdrive/c/TEMP'
PROCESSOR_LEVEL = `6'
SYSTEMROOT = `C:\WINNT'
HOMEDRIVE = `C:'
SHLVL = `1'
HOMEPATH = `\'
USERDOMAIN = `MSD-PC'
USERNAME = `administrator'
SHELL = `/bin/sh'
HOSTTYPE = `i686'
OSTYPE = `cygwin'
TERM = `cygwin'
RDBMS80 = `D:\ORANT'
_ = `/usr/bin/cygcheck'
TZ = `GMTST0GMTDT-1,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'
  cygdrive flags = 0x00000022
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = `D:/cygwin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
  (default) = `D:/cygwin/bin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
  (default) = `D:/cygwin/lib'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options

a:  fd           N/A    N/A
c:  hd  NTFS    2047Mb  68% CP CS UN PA FC
d:  hd  NTFS    7491Mb  55% CP CS UN PA FC
e:  cd           N/A    N/A

D:\cygwin\bin  /usr/bin  system  binmode
D:\cygwin\lib  /usr/lib  system  binmode
D:\cygwin  /        system  binmode
c:    /cygdrive/c  user    binmode,noumount
d:    /cygdrive/d  user    binmode,noumount

Found: D:\cygwin\bin\bash.exe
Found: D:\cygwin\bin\cat.exe
Found: D:\cygwin\bin\cpp.exe
Found: D:\cygwin\bin\find.exe
Found: D:\cygwin\bin\gcc.exe
Found: D:\cygwin\bin\gdb.exe
Found: D:\cygwin\bin\ld.exe
Found: D:\cygwin\bin\ls.exe
Found: D:\cygwin\bin\make.exe
Found: D:\cygwin\bin\sh.exe

   56k 2000/12/03 D:\cygwin\bin\cygbz21.0.dll - os=4.0 img=1.0 sys=4.0
                  "cygbz21.0.dll" v0.0 ts=2000/11/20 23:53
   45k 2001/04/25 D:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0
                  "cygform5.dll" v0.0 ts=2001/4/25 6:28
   18k 2000/10/23 D:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm.dll" v0.0 ts=2000/10/23 3:26
   17k 2001/06/28 D:\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory4.dll" v0.0 ts=2001/1/7 4:34
   21k 2001/06/28 D:\cygwin\bin\cyghistory5.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory5.dll" v0.0 ts=2001/6/28 3:27
   21k 2001/06/20 D:\cygwin\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl.dll" v0.0 ts=2001/6/20 18:09
   81k 2001/04/28 D:\cygwin\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitcl30.dll" v0.0 ts=2001/4/28 23:57
   35k 2001/04/28 D:\cygwin\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitk30.dll" v0.0 ts=2001/4/28 23:57
   45k 2001/07/04 D:\cygwin\bin\cygjbig1.dll - os=4.0 img=1.0 sys=4.0
                  "cygjbig1.dll" v0.0 ts=2001/7/4 4:25
  119k 2001/06/06 D:\cygwin\bin\cygjpeg6b.dll - os=4.0 img=1.0 sys=4.0
                  "cygjpeg6b.dll" v0.0 ts=2001/6/6 5:27
   26k 2001/04/25 D:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu5.dll" v0.0 ts=2001/4/25 6:27
  156k 2001/04/25 D:\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++5.dll" v0.0 ts=2001/4/25 6:29
  226k 2001/04/25 D:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses5.dll" v0.0 ts=2001/4/25 6:17
   15k 2001/04/25 D:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel5.dll" v0.0 ts=2001/4/25 6:27
  163k 2001/05/06 D:\cygwin\bin\cygpng2.dll - os=4.0 img=1.0 sys=4.0
                  "cygpng2.dll" v0.0 ts=2001/5/6 5:05
  108k 2001/06/28 D:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline4.dll" v0.0 ts=2001/1/7 4:34
  135k 2001/06/28 D:\cygwin\bin\cygreadline5.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline5.dll" v0.0 ts=2001/6/28 3:27
  390k 2001/04/28 D:\cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtcl80.dll" v0.0 ts=2001/4/28 23:56
    5k 2001/04/28 D:\cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0
   10k 2001/04/28 D:\cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtclreg80.dll" v0.0 ts=2001/4/28 23:56
  245k 2001/06/12 D:\cygwin\bin\cygtiff3.dll - os=4.0 img=1.0 sys=4.0
                  "cygtiff3.dll" v0.0 ts=2001/6/12 18:25
  623k 2001/04/28 D:\cygwin\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtk80.dll" v0.0 ts=2001/4/28 23:57
   41k 2001/07/04 D:\cygwin\bin\cygXpm-noX4.dll - os=4.0 img=1.0 sys=4.0
                  "cygXpm-noX4.dll" v0.0 ts=2001/7/4 2:21
   45k 2001/07/04 D:\cygwin\bin\cygXpm-X4.dll - os=4.0 img=1.0 sys=4.0
                  "cygXpm-X4.dll" v0.0 ts=2000/11/20 2:45
   49k 2001/02/03 D:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
                  "cygz.dll" v0.0 ts=2001/2/3 20:35
  678k 2001/05/21 D:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2001/5/21 4:28
    Cygwin DLL version info:
        dll major: 1003
        dll minor: 2
        dll epoch: 19
        dll bad signal mask: 19005
        dll old termios: 5
        dll malloc env: 28
        api major: 0
        api minor: 39
        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: Sun May 20 23:28:17 EDT 2001
        shared id: cygwin1S3

Use -h to see help about each section

-------------------------Windows 2000 configuration---------------------

Cygnus Win95/NT Configuration Diagnostics
Current System Time: Wed Jul 11 10:11:08 2001

WinNT Ver 5.0 build 2195 Service Pack 2

Path:	/usr/local/bin/i686-pc-cygwin
	/usr/local/bin
	/usr/bin
	/bin
	/cygdrive/c/orant/bin
	/cygdrive/c/ora817/bin
	/cygdrive/c/Program Files/Oracle/jre/1.1.7/bin
	/cygdrive/c/WINNT/system32
	/cygdrive/c/WINNT
	/cygdrive/c/WINNT/System32/Wbem
	/cygdrive/c/DMI/bin
	/usr/bin
	.
	/usr/X11R6/bin

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

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

NUMBER_OF_PROCESSORS = `1'
LOGONSERVER = `\\NTSERV'
OS2LIBPATH = `C:\WINNT\system32\os2\dll;'
COMSPEC = `C:\WINNT\system32\cmd.exe'
WINDOWID = `8388622'
SYSTEMDRIVE = `C:'
HOSTNAME = `MSD-PC3'
PROCESSOR_REVISION = `080a'
PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
COMPUTERNAME = `MSD-PC3'
WINDIR = `C:\WINNT'
USERPROFILE = `C:\Documents and Settings\keller'
PS1 = `\[\033]0;\w\007
\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$ '
PROGRAMFILES = `C:\Program Files'
LESS = `iM'
MACHTYPE = `i686-pc-cygwin'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 8 Stepping 10, GenuineIntel'
WIN32DMIPATH = `C:\DMI\'
OS = `Windows_NT'
OLDPWD = `/usr/bin'
PROCESSOR_ARCHITECTURE = `x86'
TEMP = `/cygdrive/c/DOCUME~1/keller/LOCALS~1/Temp'
PROCESSOR_LEVEL = `6'
SYSTEMROOT = `C:\WINNT'
HOMEDRIVE = `D:'
DISPLAY = `localhost:0.0'
ALLUSERSPROFILE = `C:\Documents and Settings\All Users'
LOGNAME = `keller'
SHLVL = `1'
APPDATA = `C:\Documents and Settings\keller\Application Data'
COMMONPROGRAMFILES = `C:\Program Files\Common Files'
HOMEPATH = `\USERS\keller'
USERDOMAIN = `EBI'
USERNAME = `keller'
SHELL = `/bin/bash'
HOSTTYPE = `i686'
OSTYPE = `cygwin'
TERM = `xterm'
_ = `/usr/bin/cygcheck'
TZ = `GMTST0GMTDT-1,M3.5.0/1,M10.5.0/2'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  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)

a:  fd  FAT        1Mb 100% CP    UN           SUSE71_BOOT
c:  hd  NTFS   38162Mb  28% CP CS UN PA FC
d:  cd           N/A    N/A

C:\cygwin\bin  /usr/bin  system  binmode
C:\cygwin\lib  /usr/lib  system  binmode
c:\downloads  /cygdrive/downloads  system  binmode
C:\cygwin  /        system  binmode
c:    /cygdrive/c  user    textmode,noumount

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

   56k 2000/12/03 C:\cygwin\bin\cygbz21.0.dll - os=4.0 img=1.0 sys=4.0
                  "cygbz21.0.dll" v0.0 ts=2000/11/20 23:53
   45k 2001/04/25 C:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0
                  "cygform5.dll" v0.0 ts=2001/4/25 6:28
   18k 2000/10/23 C:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm.dll" v0.0 ts=2000/10/23 3:26
   17k 2001/01/07 C:\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory4.dll" v0.0 ts=2001/1/7 4:34
   14k 2000/10/23 C:\cygwin\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl.dll" v0.0 ts=2000/10/23 20:02
   81k 2000/12/05 C:\cygwin\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitcl30.dll" v0.0 ts=2000/11/26 1:43
   35k 2000/12/05 C:\cygwin\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitk30.dll" v0.0 ts=2000/11/26 1:43
   45k 2000/10/22 C:\cygwin\bin\cygjbig1.dll - os=4.0 img=1.0 sys=4.0
                  "cygjbig1.dll" v0.0 ts=2000/10/23 0:06
  119k 2001/06/06 C:\cygwin\bin\cygjpeg6b.dll - os=4.0 img=1.0 sys=4.0
                  "cygjpeg6b.dll" v0.0 ts=2001/6/6 5:27
   26k 2001/04/25 C:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu5.dll" v0.0 ts=2001/4/25 6:27
  156k 2001/04/25 C:\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++5.dll" v0.0 ts=2001/4/25 6:29
  226k 2001/04/25 C:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses5.dll" v0.0 ts=2001/4/25 6:17
   15k 2001/04/25 C:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel5.dll" v0.0 ts=2001/4/25 6:27
  163k 2001/05/06 C:\cygwin\bin\cygpng2.dll - os=4.0 img=1.0 sys=4.0
                  "cygpng2.dll" v0.0 ts=2001/5/6 5:05
  108k 2001/01/07 C:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline4.dll" v0.0 ts=2001/1/7 4:34
  390k 2000/12/05 C:\cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtcl80.dll" v0.0 ts=2000/11/26 1:39
    5k 2000/12/05 C:\cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0
   10k 2000/12/05 C:\cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtclreg80.dll" v0.0 ts=2000/11/26 1:39
  245k 2001/06/12 C:\cygwin\bin\cygtiff3.dll - os=4.0 img=1.0 sys=4.0
                  "cygtiff3.dll" v0.0 ts=2001/6/12 18:25
  623k 2000/12/05 C:\cygwin\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtk80.dll" v0.0 ts=2000/11/26 1:43
   41k 2001/05/28 C:\cygwin\bin\cygXpm-noX4.dll - os=4.0 img=1.0 sys=4.0
                  "cygXpm-noX4.dll" v0.0 ts=2001/5/28 18:57
   49k 2001/02/03 C:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
                  "cygz.dll" v0.0 ts=2001/2/3 20:35
  678k 2001/05/21 C:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2001/5/21 4:28
    Cygwin DLL version info:
        dll major: 1003
        dll minor: 2
        dll epoch: 19
        dll bad signal mask: 19005
        dll old termios: 5
        dll malloc env: 28
        api major: 0
        api minor: 39
        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: Sun May 20 23:28:17 EDT 2001
        shared id: cygwin1S3

Use -h to see help about each section

-- 
========================================================================
Peter Keller.                     | "Research without indebtedness is
European Bioinformatics Institute,|  suspect, and somebody must always,
Hinxton Hall,                     |  somehow, be thanked."
Cambridge, CB10 1SD, UK           |                     --- Umberto Eco
-----------------------------------
Email: [email-masked] |
Tel. (+44/0)1223 494637 | Macromolecular Structure Database
Fax. (+44/0)1223 494468 | http://msd.ebi.ac.uk
========================================================================

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