Skip to main content

Problems in the FTP Server Implementation

The FTP server is implemented in a manner that some readers may find reminiscent of Padlipsky's "Unified User Level Protocol" (RFC 451, NIC #14135). Rather than directly executing most FTP functions (in particular, system access and file transfer functions), it merely maps FTP commands into local commands which it "types" on a pseudo-Teletype (PTY) to a subjob, and similarly maps local responses into FTP responses.

This scheme makes maximum use of existing software and mechanisms for user authentication, accounting, and file access, and eliminates the need for the (privileged) FTP server to perform them interpretively. (This conforms to the "principle of least privilege" described in RFC 501, NIC #15818.)

In this implementation, FTP data transfers are performed by an entirely different process (with a different user identification) from the one that manages the server end of the Telnet connection. Hence, since server sockets S and S+1 belong to the server "control" job and sockets S+2 and S+3 are in the same 256-socket number range, the latter two sockets are inaccessible to the "data transfer" subjob.

Those who attended last spring's FTP meeting may recall that I objected strenuously to the requirement that the FTP server use a fixed pair of data sockets relative to its Telnet sockets, as opposed to the old scheme in which the server has complete freedom in the choice of its data sockets. The principal reason is that it would seem to rule out the "two-process" scheme I have just described.

In fact, in our case there is a way around the problem. The FTP server control job can open the data connections itself, then "reassign" the created "device" to the data transfer subjob. A kludgey solution at best, and one I would rather have avoided! Inter-job socket reassignment is hardly an operation one is likely to find available in most operating systems.