Subject: Maintaining timestamps with ftp-gw

From: Jeff Barnette <[email-masked]>
Date: Tue, 6 Mar 2001 10:10:58 -0600 (CST)

[To be removed from this list send the message "unsubscribe fwtk-users" in the
BODY of a mail message to [email-masked].]

I asked this question 2 weeks ago and got zero replies.  I'll ask it once
more before putting it in the "nobody knows and they're not sending 'I
dunno' responses".

This regards a RedHat 6.2 box using ncftp as the ftp client.

ncftp has a handy feature whereby it can skip any download where a file
already exists on the local machine with the same name, size and
timestamp.  This works great for me when I use my dial-up connection,
which doesn't go through the ftp-gw.  However, when I use my network
connection at work, which _does_ go through the ftp-gw, the timestamps
always get set to the current time.  Is there a 'switch' or other
technique that I haven't found yet?

Thanks for any help,

Jeff

---

From: Ted Keller <[email-masked]>
Date: Tue, 6 Mar 2001 12:59:42 -0500 (EST)

Jeff,

Well I'll respond but I don't know the answer.  Question, however, what
timestamp does your ftp client use to determine if it is new?  The last
updated? date created? or some other time maintained by the OS.  Would
probably like to put a trace on the client to see what it is sending to
the server; same with the ftp-gw - and see what the different responses
are.  The ftp-gw isn't too bad if we have to do a small code hack to
include that support.

tek

---

From: Michel Bardiaux <[email-masked]>
Date: Tue, 06 Mar 2001 18:12:04 +0100

Jeff Barnette wrote:
 > always get set to the current time.  

This is unclear. Which timestamps? Which current time?

 > Is there a 'switch' or other

Could you do the same ftp session, in debug mode (if ncftp can't do
that, use the vanilla ftp client), once through the ftp-gw and once
through your dialup, so we can see which commands are issued and what
they return?

-- 
Michel Bardiaux
Peaktime Belgium S.A.  Rue Margot, 37  B-1457 Nil St Vincent
Tel : +32 10 65.44.15  Fax : +32 10 65.44.10

---

From: Rick Murphy <[email-masked]>
Date: Tue, 06 Mar 2001 18:23:15 -0500

>more before putting it in the "nobody knows and they're not sending 'I

OK, "I dunno". However..
How is ncftp getting the creation date of the remote file?  Somehow, ncftp 
isn't getting the information it needs to set the creation date on files 
you receive.
There isn't any way using the FTP protocol to reliably do that. (You can 
parse the output of a LIST command, but that's OS dependent.)
If ncftp is using an "X" command that ftp-gw is rejecting, you'll find it 
in the fwtk log file; adding that command to the command table may fix it.
(Basically, what they're trying to do can't be done reliably. This is a 
case in point.)
          -Rick

---

From: "Nico Baggus" <[email-masked]>
Date: Thu, 8 Mar 2001 21:42:47 +0100

> technique that I haven't found yet?

NcFTP tries various commands (look at the batchlog
after doing a bgget & bgstart)

The command used is MDTM.....
(is also does CLNT <client name>,
SIZE <file>)
It expects a 213 response with the requested data....

I hope it helps,
Nico Baggus

---

From: Ted Keller <[email-masked]>
Date: Thu, 8 Mar 2001 17:04:39 -0500 (EST)

Well,

This should be pretty easy to add to the ftp-ops table - and pass it along
to the server for a response.

The routine usrcmd searches ftp-ops to get a match - then calls either a
special routine - or passes it along.  Seems as if these commands to be
added to the table.

ted keller

---

From: Rick Murphy <[email-masked]>
Date: Thu, 08 Mar 2001 17:50:43 -0500

>The command used is MDTM.....

That's not "standard" FTP. (There's an internet draft proposal to add the 
command, however.) In any case, add it to the 'ops' table in ftp-gw just 
below the line that reads
         "size",         OP_CONN,        0,

just add
         "mdtm",         OP_CONN,        0,
below that line and rebuild ftp-gw.

>It expects a 213 response with the requested data....

SIZE is supported; I'm not sure what "CLNT" does (client?) - potentially 
risky until you know what it is.
         -Rick

---

From: Joseph S D Yao <[email-masked]>
Date: Thu, 8 Mar 2001 21:56:36 -0500

> (Basically, what they're trying to do can't be done reliably. This is a 

Weren't they parsing the FTPD output?  In which case, if ftp-gw
modifies it, it wouldn't be able to parse it.  Assuming a simplistic
parser.

-- 
Joe Yao				[email-masked] - Joseph S. D. Yao
COSPO/OSIS Computer Support					EMT-B
-----------------------------------------------------------------------
This message is not an official statement of COSPO policies.

---

From: Rick Murphy <[email-masked]>
Date: Thu, 08 Mar 2001 22:27:23 -0500

>modifies it, it wouldn't be able to parse it.  Assuming a simplistic

No, they're using a proposed new FTP command that returns the timestamp for 
a file.
In any case, ftp-gw doesn't do anything to modify most of the ftp 
transactions, so that shouldn't be a problem. (See my earlier post about 
how to fix this).
         -Rick

---

From: Michel Bardiaux <[email-masked]>
Date: Tue, 06 Mar 2001 18:12:04 +0100

John C. Kelley
Computer Scientist
NAILabs at Network Associates, Inc.
Glenwood, MD