<sect1 id="ch06-ed">
<title>Installing Ed-&ed-version;</title>
<?dbhtml filename="ed.html" dir="chapter06"?>

<screen>Estimated build time:           &ed-time;
Estimated required disk space:  &ed-compsize;</screen>

&aa-ed-shortdesc;
&aa-ed-dep;

<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>

<sect2>
<title>Installation of Ed</title>

<note><para>Ed isn't something which many people use. It's installed here
because it can be used by the patch program if you encounter an ed-based patch
file. This happens rarely because diff-based patches are preferred these
days.</para></note>

<para>Ed normally uses the mktemp function to create temporary files in
<filename class="directory">/tmp</filename>, but this function contains a
vulnerability (see the section on Temporary Files in <ulink
url="http://en.tldp.org/HOWTO/Secure-Programs-HOWTO/avoid-race.html"/>). The
following patch makes Ed use mkstemp instead, which is the recommended way to
create temporary files.</para>

<para>Apply the patch:</para>

<screen><userinput>patch -Np1 -i ../&ed-patch;</userinput></screen>

<para>Now prepare Ed for compilation:</para>

<screen><userinput>./configure --prefix=/usr</userinput></screen>

<para>Compile the package:</para>

<screen><userinput>make</userinput></screen>

<para>This package has a test suite available which can perform a number of
checks to ensure it built correctly.  Should you choose to run it, the 
following command will do so:</para>

<screen><userinput>make check</userinput></screen>

<para>Install the package:</para>

<screen><userinput>make install</userinput></screen>

<para>And move the programs to the <filename>/bin</filename> directory, so
they can be used in the event that the <filename>/usr</filename> partition is
unavailable.</para>

<screen><userinput>mv /usr/bin/{ed,red} /bin</userinput></screen>

</sect2>

</sect1>

