<?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="login-giveown-controlling-terminal">

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

<refnamediv>
<refname>login-giveown-controlling-terminal</refname>
<refpurpose>give ownership of the controlling terminal and chain</refpurpose>
</refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>login-giveown-controlling-terminal</command>
<arg choice='req'><replaceable>next-prog</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsection><title>Description</title>

<para>
<command>login-giveown-controlling-terminal</command> is a chain-loading utility that grants ownership of the terminal device named by the value of the <envar>TTY</envar> environment variable to the UID in the value of the <envar>UID</envar> environment variable and then chain loads to <replaceable>next-prog</replaceable> with the <citerefentry><refentrytitle>execvp</refentrytitle><manvolnum>3</manvolnum></citerefentry> function.
It also sets permissions of the terminal device to 0600.
</para>

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

</refsection>

<refsection><title>See Also</title>
<itemizedlist>
<listitem><para>
<citerefentry><refentrytitle>vc-get-terminal</refentrytitle><manvolnum>1</manvolnum></citerefentry>
</para></listitem>
<listitem><para>
<citerefentry><refentrytitle>grantpt</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para></listitem>
</itemizedlist>
</refsection>

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

</refentry>
