Skip to content

api-modernization: replace vfork in nft_popen with safer spawn model #492

@somethingwithproof

Description

@somethingwithproof

Summary

Replace vfork() usage in nft_popen.c with a safer, portable process-spawn approach.

Work

  • Replace vfork() path with posix_spawn() (preferred) or a well-guarded fork() fallback.
  • Preserve current stdin/stdout pipe behavior and fd cleanup semantics.
  • Keep retry/error handling explicit and deterministic.
  • Validate behavior across supported Unix targets (macOS, FreeBSD, Linux/Solaris variants where available).

Acceptance Criteria

  • No vfork() remains in nft_popen.c.
  • Child process setup preserves existing command execution behavior.
  • No regressions in thread-safety/cancellation behavior.
  • Logging/error handling remains actionable.

Related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions