How hfiref0x/lightftp works
LightFTP is a small FTP server. Its main workflow is startup and configuration, client command handling and authentication, then directory and file operations over FTP data connections. The server source is organized here by its documented runtime responsibilities; shared helpers and configuration parsing form the internal layer. The excerpts do not expose every command handler, so some documented capabilities are represented within the server component rather than as independently verified call paths.
Main entry points: ftpserv.c Control Sessions and Dispatch · main.c Startup and TLS Setup · cfgparse.c Configuration Parser · fspathtools.c Path and Symlink Safety
Components 17
Startup and Configuration
- Server Configuration
data/fftp.conf - Startup and TLS Setup
src/main.c - Configuration Parser
src/cfgparse.c
FTP Protocol
- Control Sessions and Dispatch
src/ftpserv.c - User Authentication
src/ftpserv.c - FTP Data Connections
src/ftpserv.c - TLS Support
src/main.c - Server Logging
src/ftpserv.c
File Operations
- Directory Commands
src/ftpserv.c - File Transfers
src/ftpserv.c
Internal Support
- Password Hashing
src/fcrypt.c - Path and Symlink Safety
src/fspathtools.c - FTP Replies and Features
src/ftpconst.c - Memory Allocation Helper
src/inc/x_malloc.h
Other components
- Server Operator
- FTP Client
- Server Filesystem
Connections 19
- Server Operator → Startup and TLS Setup: starts server
README.md - Server Operator → Server Configuration: configures
README.md - Startup and TLS Setup → Configuration Parser: parses settings
src/main.c - Startup and TLS Setup → Control Sessions and Dispatch: starts thread
src/main.c - FTP Client → Control Sessions and Dispatch: sends commands
README.md - Control Sessions and Dispatch → User Authentication: dispatches commands
src/ftpserv.c - User Authentication → Password Hashing: checks passwords
src/ftpserv.c - Control Sessions and Dispatch → FTP Data Connections: manages transfers
src/ftpserv.c - Control Sessions and Dispatch → Directory Commands: dispatches commands
src/ftpserv.c - Control Sessions and Dispatch → File Transfers: dispatches commands
src/ftpserv.c - Directory Commands → Path and Symlink Safety: resolves paths
src/ftpserv.c - File Transfers → Path and Symlink Safety: resolves paths
src/ftpserv.c - Directory Commands → Server Filesystem: accesses directories
README.md - File Transfers → Server Filesystem: reads and writes
README.md - Startup and TLS Setup → TLS Support: initializes TLS
src/main.c - Control Sessions and Dispatch → Server Logging: writes session logs
src/ftpserv.c - Control Sessions and Dispatch → FTP Replies and Features: uses replies
src/ftpserv.c - Startup and TLS Setup → Memory Allocation Helper: allocates buffers
src/main.c - Configuration Parser → Memory Allocation Helper: allocates config
src/cfgparse.c