[Tfug] python ftplib ports

Jim Secan jim at nwra.com
Tue Sep 30 07:53:08 MST 2008


Chris...

Thanks for the long response.  I'm neck-deep in system problems at the
moment, but will go over what you sent when I can.  The ports in issue are
the ones chosen by either the ftp client as the port through which data
will be passed.  IANAE on ftp, so I don't think I can answer your question
as to where this port is (client or server), all I know is that I get back
the response '501 Illegal PORT command' when it fails.  I've been assuming
that's coming from the server end, but not knowing what's going on beyond
ftplib I can't say that with certainty.

I don't want to specify a port, per se, I just want to limit the port range
so that the bottom end is well away from the nominal 1023 upper limit on
ports with fixed assignments to specific processes, say 30,000 through
50,000.  In looking at ftplib, I could see where ports were being
specified, but since they were coming from the sockets package I didn't
want to make an ad hoc change to the port in ftplib that would then not
reflect the port the socket was actually attached to.  All I could come up
with on short notice would be a kludge in ftplib that rejects all ports
provided from the sockets package that are outside this range until it gets
one inside the range.  Perhaps you've covered that in your missive.

Jim

At 06:43 AM 09/30/2008 -0700, Chris wrote:
>
>Hi, Jim!
>
>Just a sec.  Your phrasing is a bit confusing here.
>I understand that there's a port you want to specify
>(to make it *not* 1025), but *which* do you want to specify:
>   - the port on the client (where ftplib is running)
>   - the port on the ftp server
>
>I think I see how to specify either (or both).
<snip>
*---------------------*-------------------------------*
| Jim Secan           | Northwest Research Assoc, Inc |
| (jim at nwra.com)      | 2455 E. Speedway, Suite 204   |
| (520) 319-7773      | Tucson, Arizona 85719         |
*---------------------*-------------------------------*




More information about the tfug mailing list