.TH ZEXEC 1 .SH NAME zexec \- decompress and execute a compressed binary .SH SYNOPSIS .B zexec .I decompressor executable .RI [ arg "...]" .SH DESCRIPTION .B Zexec decompresses and executes a compressed binary. It does this by calling .I decompressor to uncompress .I executable to a file in .B /tmp and by calling the result with the other arguments given to .BR zexec . The temporary file is removed immediately after startup. .PP .B Zexec checks if the first two bytes of the compressed file are the magic characters .BR #! . If so then the first line of the file is skipped before it is decompressed. This allows a utility like .BR install (1) to create a compressed executable with a first line that looks like this: .PP .RS #!/usr/bin/zexec /usr/bin/zcat .RE .PP 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. .SH "SEE ALSO" .BR install (1). .SH 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. .SH AUTHOR Kees J. Bot (kjb@cs.vu.nl)