๐ zftpd v1.2.0
This release introduces structural improvements in logging, security, session handling, PS4/PS5 runtime behavior, and build tooling. It also formalizes test coverage and refines I/O robustness.
Core Changes
๐ Logging Subsystem
- Added
ftp_log.handsrc/ftp_log.c. - Session-level and command-level logging.
- Line-based logging utilities.
- Integrated logging hooks into RETR/STOR/APPE flows.
๐งช Unit Tests
-
Added:
tests/test_security.ctests/test_path_security.c
-
Makefile updates:
LIB_OBJECTStarget (build withoutmain).- Multi-test build/run support.
- Automatic test skipping on unsupported targets.
Security & Path Handling
Path Normalization & Root Enforcement (ftp_path.c)
- Hardened path component parsing.
- Strict
realpath()resolution. - Explicit validation against
session->root_path. - Prevents directory traversal and symlink escape outside session root.
PORT / PASV Handling
-
PORTrestricted to same client IP. -
PASV:
- Correct reuse/closure of previous passive socket.
- Bind to
INADDR_ANY. - Improved local IP detection for PASV response.
-
Improved lifecycle validation and socket management.
Session Layer Changes
ftp_session_t Extensions
Added:
root_path- Control RX buffer
- Authentication flags
- Rate-limiter fields
Initialization updates:
realpath(root)resolved during session init.- Socket timeouts applied at initialization.
- Rate limiting integrated into the data receive path.
Rate Limiting
-
Transfer accounting based on actual bytes received.
-
Compile-time configuration knobs in
include/ftp_config.h:- Control timeout
- Data timeout
- Transfer rate limit
- Burst size
FTP_SOCKET_TELEMETRY
Data Path & I/O
RETR / STOR / APPE
-
Aggregated byte accounting.
-
Unified data send path via
ftp_session_send_data. -
sendfileused only when rate limiting is disabled. -
STOR/APPE:
- Switched to
ftp_buffer_acquire()/ftp_buffer_release(). - Use
pal_file_write_all()for robust writes.
- Switched to
PAL Additions
New abstractions:
pal_socket_set_timeoutspal_send_allpal_file_write_all
Control replies now use pal_send_all.
Additional helpers in ftp_session.c:
wait_fd_readymonotonic_ns
PS4 / PS5 Improvements
Runtime & Startup
- Safer PID lookup.
- Termination of existing instances before bind.
- Port fallback initialization (
server_init_with_fallback). - Improved notification handling.
- Reorganized includes and improved CLI parsing for POSIX builds.
Buffers & TCP
- Increased default buffer sizes for PS4/PS5.
- Increased TCP buffer sizes.
- Improved throughput behavior under console constraints.
Build System
-
Version bump to v1.2.0.
-
Standardized MIT license headers across sources.
-
Makefile:
STRIPsupport..binoutput for PS4/PS5.- Updated deploy targets.
- PS5 links
libSceNotification.
-
README rewritten and streamlined.
Supported Platforms
- OrbisOS (PS4)
- ProsperoOS (PS5)
- macOS
- Linux (Debian)
Full Changelog:
v1.1.0...v1.2.0