www.delorie.com/gnu/docs/zlibc/zlibc_3.html   search  
 
Buy GNU books!


Zlibc

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. Installing zlibc

  1. If you install zlibc on Linux, make sure that your shared loader (ld-linux.so.1/ld.so) understands LD_PRELOAD. (Best if ld.so-1.8.5 or more recent)

  2. Type ./configure. This runs the GNU autoconfigure script which configures the `Makefile' and the `config.h' file. You may compile time configuration options to ./configure, see for details.

  3. Type make to compile zlibc.

  4. Type make install to install zlibc and associated programs to its final target.

  5. To use this module, set the environment variable LD_PRELOAD to point to the object. Example (sh syntax):

     
          LD_PRELOAD=/usr/local/lib/uncompress.o
          export LD_PRELOAD
    

    or (csh syntax):

     
          setenv LD_PRELOAD /usr/local/lib/uncompress.o
    
    On linux, use /lib/uncompress.o instead of /usr/local/lib/uncompress.o .

    You might want to put these lines in your `.profile' or `.cshrc' in order to have the uncompressing functions available all the time.

  6. Compress your files using gzip and enjoy

For security reasons, the dynamic loader disregards environmental variables such as LD_PRELOAD when executing set uid programs.

However, on Linux, you can use zlibc with set uid programs too, by using one of the two methods described below:

  1. You may ing the path to `uncompress.o' into `/etc/ld.so.preload' instead of using LD_PRELOAD.

    WARNING: If you use `/etc/ld.so.preload', be sure to install `uncompress.o' on your root filesystem, for instance in /lib, as is done by the default configuration. Using a directory which is not available at boot time, such as /usr/local/lib will cause trouble at the next reboot!

    It is also careful to remove zlibc from `/etc/ld.so.preload' when installing a new version. First test it out using LD_PRELOAD, and only if everything is ok, put it back into `/etc/ld.so.preload'. The zlibc package also supplies four statically linked programs srm, smv, sln and ssln, which are equivalen to rm, mv, ln and ln -s. These can be used in case anything goes wrong with the installation.

  2. If you have a version of ld.so which is more recent than 1.9.0, you can set LD_PRELOAD to just contain the basename of `uncompress.o' without the directory. In that case, the file is found as long as it is in the shared library path (which usually contains `/lib' and `/usr/lib')). Because the search is restricted to the library search path, this also works for set-uid programs.

    Example (sh syntax):

     
          LD_PRELOAD=uncompress.o
          export LD_PRELOAD
    

    or (csh syntax):

     
          setenv LD_PRELOAD uncompress.o
    

    The advantage of this approach over `ld.so.preload' is that zlibc can more easily be switched off in case something goes wrong.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003