Go to the first, previous, next, last section, table of contents.


Copyright (C) 1993, 1994, 1995, 1996, 1997 Alain Knaff

Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one and provided that the privacy of any reader of the resulting derived work is respected. In particular is it strictly forbidden to make this documentation available on a World Wide Web server which deals cookies. However, keeping access statistics is allowed.

Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.

Introduction

The zlibc package allows transparent on the fly uncompression of gzipped files. Your programs will be able to access any compressed file, just as if they were uncompressed. Zlibc will transparently uncompresses the data from these files as soon as they are read, just as a compressed filesystem would do. No kernel patch, no recompilation of these executables and no recompilation of the libraries is needed.

It is not (yet) possible execute compressed files with zlibc. However, there is another package, called tcx, which is able to uncompress executables on the fly. On the other hand tcx isn't able to uncompress data files on the fly. Fortunately, the both zlibc and tcx may coexist on the same machine without problems.

This documentation looks most pretty when printed or as html. Indeed, in the info version certain examples are difficult to read due to the confusing quoting conventions of info.

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.


Go to the first, previous, next, last section, table of contents.