Subject: [Fwd: Re: Tracking user ratios (RATIO SUGGESTIONS)]

From: Brad Waite <[email-masked]>
Date: Wed, 08 Oct 1997 13:10:27 -0600

Brad Waite wrote:
 
 *DISCLAIMER*
         I _just_ started looking at the code today, so forgive any
ignorance.
 
 It looks to me that the easiest way would be to put additional flags in
 the routines that handle the RETR- and STOR-type functions.  From what
I
 gather, that's done in ftpcmd.y.
 
 Either way, when a STOR command is finished, add the number of (STOR'd
 bytes received * ratio) to the user's existing byte count.  Since we'd
 want the ratio state to be session-independent, we'd store it to some
 sort of file.
 
 On the RETR side, we'd have to compare the user's byte count to the
size
 of file requested before starting the RETR and puke if he doesn't have
 enough credit.  After the command has finished, we'd need to subtract
 RETR'd bytes from the byte_count.
 
 Another thing to consider is the option of a file ratio as opposed to a
 byte ratio.  Still the same concept.
 
 I've not seen a site that stores ratios for guest or anon users, but
 that might be possible if you stored/looked up the user by a
 username/passwd pair or username/remoteIP pair.  Obviously, this
 wouldn't be accurate nor secure, but would add _some_ functionality.
 
 I see the ftpaccess entry looking something like this:
 
         ratio   CLASS   RATIO   TYPE    BELOW-RATIO-MSG (format)
 
         ratio   local   1:5     byte    /usr/local/lib/ftpd/below.txt
(example)
         ratio   remote  1:2     file    /usr/local/lib/ftpd/below.txt
 
 I hope I haven't overstated the obvious.
 
 -Brad
 
 Phil Schwan wrote:
 >
 > On Wed, 8 Oct 1997, Brad Waite wrote:
 >
 > > Is there any way to track user send/get ratios in wu-ftpd?  I
didn't see
 > > anything in the source or docs, but thought I'd ask.
 > >
 > > If there's not, would it be possible to write a 'log wrapper' that
tails
 > > the log files and makes adjustments to ftpaccess?  And if it were
 > > possible (I'm assuming it is), comments on feasability?
 >
 > Well, I was planning on sometime relatively soon working on putting
ratios
 > into the code.  If you wanna hang on, I might have it done in a
weekend or
 > two depending on just how many midterms and papers are due :)
 >
 > Incidentally, if anyone has any suggestions as to how this should be
done
 > that they want me to consider, just drop me a note.  Put something in
 > capital letters in the title like "RATIO SUGGESTIONS" or I'm apt to
 > accidentally delete it as I'm "reading" linux-kernel :)
 >
 > 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)