Subject: Re: Execution of programs within ftp

From: "Karl O. Pinc" <[email-masked]>
Date: Fri, 3 Jan 1997 16:52:26 -0600

>I have downloaded the tcpwrappers. Could you tell me where TWIST fits in.
>Is it part of the tcpwrappers or the ftp protocol or something else?
>
>Thanks
>
>
>>
>> >Can anyone supply or point me to info on wrapping wuftp so that as a
>> >client is about to download or finished downloading some other
>> >programs can be run and results of these other programs can be
>> >displayed back to the user during the users session. One way would be
>> >just modifiy the code at the appropriate place to exec the desired
>> >program, but I was looking for something more standard.
>>
>> Use tcpwrappers with TWIST.  Send lines beginning with 220 to standard out
>> (see ftp protocol rfc for syntax details.)  Tcpwrappers can be found at
>> purdue, somewhere.  Pointer at http://www.meme.com/soft.
>
>--
>Doug Courtney
>[email-masked]
>(908)949-3597

TWIST is part of tcpwrappers.  You use it in the tcpwrappers configuration
file to tell it to run a particular command line when a particular kind of
network connection is established.  So, your command line would run some
other program before and/or after the ftp session.  I may have
misinterperted your question.  This technique will not send results of a
program before or after each file transfer, but only before or after a
complete ftp session.

To "wrap" individual file transfers, look at how wu-ftpd supports programs
like "tar", which allow a user to tar a directory and send the result back.
I haven't checked out the details, but it probably involves something as
simple as putting your programs binarys and libraries into the anonymous
ftp root.  rtfm  I'd guess you could, as a total hack, replace the "tar"
program in the ftp root with your program.  Then, when the user asks for a
"tar" to tar and send the results, your program is run instead.  To get
some data to come back as "data" and some to come back as "message" could
be tricky.  Certainly you can have one or the other because both "ls" and
"tar" run on the server and return results.

Now you've got me curious.  Please post whatever you figure out.

Karl

May the Legos (TM) always be swept from your path in the night.