github seregonwar/zftpd v1.2.0
zftpd v1.2.0

latest releases: v1.7.1, v1.7.0, v1.6.0...
9 months ago

๐Ÿš€ 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.h and src/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.c
    • tests/test_path_security.c
  • Makefile updates:

    • LIB_OBJECTS target (build without main).
    • 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

  • PORT restricted 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.

  • sendfile used only when rate limiting is disabled.

  • STOR/APPE:

    • Switched to ftp_buffer_acquire() / ftp_buffer_release().
    • Use pal_file_write_all() for robust writes.

PAL Additions

New abstractions:

  • pal_socket_set_timeouts
  • pal_send_all
  • pal_file_write_all

Control replies now use pal_send_all.

Additional helpers in ftp_session.c:

  • wait_fd_ready
  • monotonic_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:

    • STRIP support.
    • .bin output for PS4/PS5.
    • Updated deploy targets.
    • PS5 links libSceNotification.
  • README rewritten and streamlined.

Supported Platforms

  • OrbisOS (PS4)
  • ProsperoOS (PS5)
  • macOS
  • Linux (Debian)

Release Downloads

Full Changelog:
v1.1.0...v1.2.0

Don't miss a new zftpd release

NewReleases is sending notifications on new releases.