<?xml version="1.0" encoding="UTF-8"?>
<!-- **************************************************************************
.... For copyright and licensing terms, see the file named COPYING.
.... **************************************************************************
.-->
<?xml-stylesheet href="docbook-xml.css" type="text/css"?>

<refentry id="chroot">

<refmeta xmlns:xi="http://www.w3.org/2001/XInclude">
<refentrytitle>chroot</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">user commands</refmiscinfo>
<refmiscinfo class="source">nosh</refmiscinfo>
<xi:include href="version.xml" />
</refmeta>

<refnamediv><refname>chroot</refname><refpurpose>change root then chain</refpurpose></refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>chroot</command> <arg choice='req'><replaceable>directory</replaceable></arg> <arg choice='req'><replaceable>next-prog</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsection><title>Note</title>

<para>
Some operating systems come with a <command>chroot</command> command that does not chain, but that instead spawns its target as a child process.
This command does not fork a child process, and so is suitable for use in supervised command chains run under control of a d&#xe6;mon supervisor.
</para>

</refsection><refsection><title>Description</title>

<para>
<command>chroot</command> is a chain-loading utility that changes its current root to <replaceable>directory</replaceable> and then chain loads to <replaceable>next-prog</replaceable> with the <citerefentry><refentrytitle>execvp</refentrytitle><manvolnum>3</manvolnum></citerefentry> function.
</para>

<para>
<replaceable>next-prog</replaceable> may contain its own command line options, which <command>chroot</command> will ignore.
</para>

<para>
The functionality of the GNU <command>chroot</command> command can be achieved by combining this command with <citerefentry><refentrytitle>setuidgid</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para>

</refsection><refsection><title>Security</title>

<para>
On most systems, only the superuser is permitted to execute the underlying system call.
</para>

</refsection><refsection><title>Author</title>
<para><author><personname><firstname>Jonathan</firstname> <surname>de Boyne Pollard</surname></personname></author></para>
</refsection>

</refentry>
