zlib.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-system-zlib" role="wrap">
  7. <title>Zlib-&zlib-version;</title>
  8. <?dbhtml filename="zlib.html"?>
  9. <indexterm zone="ch-system-zlib"><primary sortas="a-Zlib">Zlib</primary></indexterm>
  10. <sect2 role="package"><title/>
  11. <para>The Zlib package contains compression and decompression routines used by
  12. some programs.</para>
  13. <segmentedlist>
  14. <segtitle>&buildtime;</segtitle>
  15. <segtitle>&diskspace;</segtitle>
  16. <seglistitem><seg>0.1 SBU</seg><seg>2.7 MB</seg></seglistitem>
  17. </segmentedlist>
  18. <segmentedlist>
  19. <segtitle>&dependencies;</segtitle>
  20. <seglistitem><seg>Binutils, Coreutils, GCC, Glibc, Make, and Sed</seg></seglistitem>
  21. </segmentedlist>
  22. </sect2>
  23. <sect2 role="installation">
  24. <title>Installation of Zlib</title>
  25. <para>Zlib has a buffer overflow vulnerability that can lead to a Denial of
  26. Service attack. The following patch fixes the problem:</para>
  27. <screen><userinput>patch -Np1 -i ../zlib-&zlib-version;-security_fix-1.patch</userinput></screen>
  28. <note><para>Zlib is known to build its shared library incorrectly if
  29. <envar>CFLAGS</envar> is specified in the environment. If using a
  30. specified <envar>CFLAGS</envar>
  31. variable, be sure to add the <parameter>-fPIC</parameter> directive to
  32. the <envar>CFLAGS</envar> variable for the duration of the
  33. configure command below, then remove it afterwards.</para></note>
  34. <para>Prepare Zlib for compilation:</para>
  35. <screen><userinput>./configure --prefix=/usr --shared --libdir=/lib</userinput></screen>
  36. <para>Compile the package:</para>
  37. <screen><userinput>make</userinput></screen>
  38. <para>To test the results, issue:
  39. <userinput>make check</userinput>.</para>
  40. <para>Install the shared library:</para>
  41. <screen><userinput>make install</userinput></screen>
  42. <para>The previous command installed a <filename
  43. class="extension">.so</filename> file in <filename
  44. class="directory">/lib</filename>. We will remove it and relink it into
  45. <filename class="directory">/usr/lib</filename>:</para>
  46. <screen><userinput>rm /lib/libz.so
  47. ln -sf ../../lib/libz.so.&zlib-version; /usr/lib/libz.so</userinput></screen>
  48. <para>Build the static library:</para>
  49. <screen><userinput>make clean
  50. ./configure --prefix=/usr
  51. make</userinput></screen>
  52. <para>To test the results again, issue:
  53. <userinput>make check</userinput>.</para>
  54. <para>Install the static library:</para>
  55. <screen><userinput>make install</userinput></screen>
  56. <para>Fix the permissions on the static library:</para>
  57. <screen><userinput>chmod 644 /usr/lib/libz.a</userinput></screen>
  58. </sect2>
  59. <sect2 id="contents-zlib" role="content"><title>Contents of Zlib</title>
  60. <segmentedlist>
  61. <segtitle>Installed libraries</segtitle>
  62. <seglistitem><seg>libz.[a,so]</seg></seglistitem>
  63. </segmentedlist>
  64. <variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
  65. <?dbfo list-presentation="list"?>
  66. <?dbhtml list-presentation="table"?>
  67. <varlistentry id="libz">
  68. <term><filename class="libraryfile">libz</filename></term>
  69. <listitem>
  70. <para>Contains compression and un-compression
  71. functions used by some programs</para>
  72. <indexterm zone="ch-system-zlib libz"><primary sortas="c-libz">libz</primary></indexterm>
  73. </listitem>
  74. </varlistentry>
  75. </variablelist>
  76. </sect2>
  77. </sect1>