btcpserv 1.0 - Copyright (C) 1998 Joe Vaughan <joev@freddyfrog.com>

btcpserv is a tcp daemon that binds to a specified address
on a specified port and runs a specified program (that talks to
STDIN/STDOUT/STDERR)

I hacked it up because I needed to bind a modified pop3 server
to specific addresses in order to read virtual passwd files and
mailboxes but in theory it can be used for just about anything 
that doesn't suit inetd (bound to all ports) use or doesn't require
the security of tcpd.

Most of the code is cobbled together from bit's I've read all over 
the net who's authors I can no longer remember. So, I've left the
variables and comments unchanged in the hopes that the original
authors may see them and let me know so I can properly attrib.

I do know:
The chunk for setting process titles comes from the sendmail source.
The chunk for execing the specified program upon connection comes from
tcp-server 1.0 by Kyle R. Burton  mortis@voicenet.com who, in turn,
attributes Martin Mares <mj@atrey.karlin.mff.cuni.cz> for the 
technique.

This program work on Linux, anything else will probably require a
few hefty kicks to the code... or not, I don't know. 

Note, when I mentioned cobbled together above, I really meant it. It's
not pretty. I have no idea if it's littered with security holes or
anything. There are variables thrown around all over the place. Some day
I will clean it up, but for now, it works for me. If it works for you 
too then that's cool.

This software is released under the terms of the GNU Public License (GPL)
Please read the file COPYING for details.

BUILD
-----

	type 'make'


INSTALL
-------
	to install in /usr/local/bin type 'make install'
	to install elsewhere, change the INSTDIR variable in the Makefile
	and then type 'make install'

USAGE
-----

	btcpserv requires 3 parameters:

	-a <address> : The address on the local system to bind to and listen
                   for connections on.

	-p <port>    : Port to listen on.

	-x <program> : Program to be executed e.g. ipop3d etc.

	Note: remember, if you need to pass parameters to the executing program
          you will have to escape them from the shell (so they don't get 
          interpreted as further parameters to btcpserv. 

          e.g. /usr/local/bin/btcpserv -a 192.168.1.1 -p 110 \
               -x '/usr/local/bin/myprog -option 1 -option2'
		  
          You get the idea :)


Finally, if you find this hack useful or have any comments etc I wouldn't 
mind knowing about it at mailto:joev@freddyfrog.com

Regards
JoeV. 
