aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/ed-inst.xml
diff options
context:
space:
mode:
authorGerard Beekmans <gerard@linuxfromscratch.org>2001-08-09 01:05:51 +0000
committerGerard Beekmans <gerard@linuxfromscratch.org>2001-08-09 01:05:51 +0000
commit6892a732276a80a648d3e4914ecf9852ab523632 (patch)
tree8e0a373f7a3f07b0f67d05f9e31d2f770ab4994f /chapter06/ed-inst.xml
parent7f01eef0f4cf564a11f0c438422872feb0e7621f (diff)
Fixed ed symlink vulnerability
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@949 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter06/ed-inst.xml')
-rw-r--r--chapter06/ed-inst.xml7
1 files changed, 6 insertions, 1 deletions
diff --git a/chapter06/ed-inst.xml b/chapter06/ed-inst.xml
index 4e896a9cc..ced1cb48d 100644
--- a/chapter06/ed-inst.xml
+++ b/chapter06/ed-inst.xml
@@ -3,7 +3,12 @@
<para>Install Ed by running the following commands:</para>
-<para><screen><userinput>./configure --prefix=/usr &amp;&amp;</userinput>
+<para><screen><userinput>cp buf.c buf.c-backup &amp;&amp;</userinput>
+<userinput>sed 's/int u/int u, sfd/' buf.c-temp | \</userinput>
+<userinput>&nbsp;&nbsp;&nbsp;sed '/.*\*mktemp.*/d' | \</userinput>
+<userinput>&nbsp;&nbsp;&nbsp;sed 's/.*if (mktemp.*/ sfd = mkstemp(sfn);\</userinput>
+<userinput>&nbsp;&nbsp;&nbsp;if ((sfd == -1) || (sfp = fopen (sfn, "w+")) == NULL)/' &gt; buf.c</userinput>
+<userinput>./configure --prefix=/usr &amp;&amp;</userinput>
<userinput>make &amp;&amp;</userinput>
<userinput>make install &amp;&amp;</userinput>
<userinput>mv /usr/bin/ed /usr/bin/red /bin</userinput></screen></para>