Subject: syslog instead of xferlog

From: Andreas Sindermann <[email-masked]>
Date: Tue, 10 Mar 1998 15:29:11 +0100 (MET)

Hello,

is it possible to send *all* output produced by in.ftpd to syslog
instead xferlog? When starting in.ftpd via inetd.conf with:

in.ftpd -i -o -l

only the following is sent to syslog:

Mar 10 15:12:31 xxx ftpd[5643]: FTP LOGIN FROM yyy [yy.yy.yy.yy], sinder
Mar 10 15:12:43 xxx ftpd[5643]: FTP session closed

The incoming and outgoing traffic is logged to xferlog as usual:

Tue Mar 10 15:12:39 1998 1 yyy 8055 <filename> b _ o r sinder ftp 0 *

It was nice if I could send both messages to syslog (and collect all
these messages on the LOGHOST instead of having xferlog files on all
machines).

This setup is not intended for anonymous ftp of course but as a
replacement for the regular Solaris 2.6 in.ftpd.

Andreas

---

From: Phil Schwan <[email-masked]>
Date: Tue, 10 Mar 1998 09:46:46 -0500 (EST)

On Tue, 10 Mar 1998, Andreas Sindermann wrote:

> instead xferlog?

I'll give you a "patch" of sorts.  Open up src/ftpd.c and look around line
1,974 (it's exactly 1,974 in beta 15).  It should read:

        write(xferlog, msg, strlen(msg));

change that to (or add an additional line):

        syslog(LOG_INFO, msg);

The output to the log will change somewhat, it'll add a header to it.
This header will make xferstats unhappy, so if you're going to want to do
xferstats processing, I recommend that you continue storing it to two
files.  The output will look like this:

==> /var/adm/messages <==
Mar 10 09:43:15 sod ftpd[26400]: Tue Mar 10 09:43:15 1998 1 localhost
25266 /unixwars.tex b _ o r pschwan ftp 0 *

==> /var/adm/ftpd/xferlog <==
Tue Mar 10 09:43:15 1998 1 localhost 25266 /unixwars.tex b _ o r
pschwan ftp 0 *

You'll note that the syslog() call adds a date and process header.
*shrug*  That's the quickest fix, and if you don't mind, I'd say live with
it :)

Good luck,

Phil

--------------------------------------------------------------------------
'The ultimate seal on any software product is not any sort of kite mark or
standards conformance certificate, it's that label that says, "Destruction
tested by Alan Cox.... Survived."' -- Clive Dolphin (3Com PDD)