ProFTPD Developer's Guide: Tour of a Session

ProFTPD Version 1.2

Table of Contents

Tour of a Session
The aim here is to provide a walkthrough of an FTP session, from start to finish, in detail. This will help to know what the server is doing at a given point during a session, and at what points modules are called upon to do their magic during the handling of that session.

First, the server must be started. On startup, the server parses and handles any command line options, initializes some subsystems, calls all registered modules' initialization functions (if they registered one), parses the configuration file(s), then readies itself to receive FTP client connection requests. server_loop() fork_server() - block SIGTERM, SIGCHLD, SIGUSR1, SIGUSR2 while it's forking - parent closes the socket fd, adds the child to its maintained list of children, then unblocks the signals - child unblocks signals, registers handlers for SIGUSR1, SIGUSR2. Returns default handler to SIGCHLD, ignores SIGHUP (good!) - do reverse DNS lookups (twice?), set socket options - find the server for this connection (IP vs DNS names, FTP protocol limitations, DefaultServer), deallocate all other servers ( cross-server communication!) - assigns permanent_pool to session.pool (what the hell?) - check for /etc/shutmsg - check for directives - attempt to get ID of remote user using RFC1413 identd - call all module child init functions cmd_loop() - display connection information, greetings - set/reset timers - double-check argument against CommandBufferSize - dispatch command to handlers: dispatch cycle, commands allowed before/after authentication dispatch_cmd() - double-check command against Allow/DenyFilters - log command in scoreboard file via log_add_run() - call command handler end_login()

Table of Contents

Author: $Author: castaglia $
Last Updated: $Date: 2003/01/02 17:39:36 $

© Copyright 2000-2003 TJ Saunders
All Rights Reserved