zexec(1)
NAME
zexec - decompress and execute a compressed binary
SYNOPSIS
zexec decompressor executable [arg...]
DESCRIPTION
Zexec decompresses and executes a compressed binary. It does this by
calling decompressor to uncompress executable to a file in /tmp and by
calling the result with the other arguments given to zexec. The
temporary file is removed immediately after startup.
Zexec checks if the first two bytes of the compressed file are the magic
characters #!. If so then the first line of the file is skipped before
it is decompressed. This allows a utility like install(1) to create a
compressed executable with a first line that looks like this:
#!/usr/bin/zexec /usr/bin/zcat
The kernel recognizes this as a request to run /usr/bin/zexec as an
interpreter for the file, just like it runs shell scripts that start with
#!/bin/sh. The compressed executable can thus be used transparently,
without the user knowing that it is compressed. The only clue is the
slower startup time.
SEE ALSO
install(1).
BUGS
A setuid compressed executable works as required, but setuid #! scripts
are inheritely insecure. It is trivial to misuse such a script to make a
setuid shell.
AUTHOR
Kees J. Bot (kjb@cs.vu.nl)