Is it possible to define the root directory in a cross compiled program

Eliot Moss moss@cs.umass.edu
Tue Jan 5 15:09:23 GMT 2021


On 1/5/2021 10:02 AM, Bill Stewart wrote:
 > On Tue, Jan 5, 2021 at 6:34 AM Eliot Moss wrote:
 >
 >> Is there a Windows equivalent to chroot (either the program or the library/system call)?
 >
 > See: https://cygwin.com/cygwin-ug-net/highlights.html
 >
 > Quoting:
 >
 > "Chroot is supported. Kind of. Chroot is not a concept known by
 > Windows. This implies some serious restrictions. First of all, the
 > chroot call isn't a privileged call. Any user may call it. Second, the
 > chroot environment isn't safe against native windows processes. Given
 > that, chroot in Cygwin is only a hack which pretends security where
 > there is none. For that reason the usage of chroot is discouraged.
 > Don't use it unless you really, really know what you're doing."
 >
 > What I have found is that the cygwin chroot is not a security boundary

Right.  My impression was that the OP was more interested in having the
functionality of where / is, though I could be wrong, of course.

I also saw web posts about Windows' RUNAS command, which deals with some of
the security implications, but does not re-root your file hierarchy.

Best - Eliot


More information about the Cygwin mailing list