Handling Strange Gateways...
David Masterson (davidm@prism.kla.com)
Sat, 3 Sep 1994 16:38:35 -0700
Over the past couple of weeks, I've been locked behind a strange gateway that
doesn't seem to conform to what ange-ftp is expecting in the way of a normal
or smart gateway. I've been messing with the code for ange-ftp in Emacs 19.25
to see if I could get it to handle the gateway. I've just broken through our
gateway to the outside world with ange-ftp and thought I'd relay some of my
experience to ange-ftp-lovers (and efs-testers as I think it applies there as
well). NOTE: I am not a Elisp programmer, but I'm an experienced enough
programmer to be able to dig into someone else's code and make minor
modifications to it.
The KLA Gateway
This is my first experience being a user of a gateway, so I don't know if this
particular set of software is a hack of our system administrators or something
in more general use throughout the Net. As I understand it now, the protocol
is as follows:
1. Connect to the TCPR-PORTMAPPER socket on the gateway and ask it to set up a
connection to a remote host for Telnet or FTP purposes and set up a relay
socket on the gateway for the local host to talk to the remote host.
2. TCPR-PORTMAPPER sets up the connection and then tells the local host what
random socket for the local host to connect to on the gateway.
3. Start FTP (since that's my interest) and tell it to connect to that port on
the gateway.
Note that the determination of what socket to use is made *before* starting up
FTP (our FTP doesn't handle this automatically) and will be different for
every FTP connection made through the gateway. Our gateway administrators
have given us a Perl script to make this look like FTP, but, because of this
protocol, its not a direct replacement for FTP that ange-ftp could use (the
protocol requires that the remote hostname be on the command line).
What I did to get it to work
1. I hacked the Perl command to at least accept the FTP command line arguments
that ange-ftp sends to FTP ("-i -n -g -v") with the hostname.
2. I hacked ange-ftp-start-process to add the current hostname to the command
line arguments that it sends to FTP.
3. I hacked ange-ftp-normal-login (ange-ftp-smart-login might have been
better) to send a blank line instead of the OPEN command that it first
sends to FTP (if I just removed the OPEN, ange-ftp had synchronization
problems).
What I would suggest for the future
First, it seems that a hook is needed someplace just before the FTP command is
issued in order to allow a user to "adjust" the command line on the basis of
the host. Second, it seems that another hook is needed to allow a specialized
form of login (or no login at all) because the previous may have taken care of
that in the process of setting up the FTP command.
Does this make sense (especially for EFS)?
--
==================================================================
David Masterson KLA Instruments
408-456-6836 160 Rio Robles
davidm@prism.kla.com San Jose, CA 95161
==================================================================
I only speak for myself -- it keeps me out of trouble