Special nodes: --specials refuses sockets although mknod(S_IFSOCK) works unprivileged; --copy-devices is a no-op #288

Closed
opened 2026-09-15 19:33:33 +02:00 by TapTap · 1 comment
Owner

Audit findings (src/shared/file_receive.c, src/client/scanner.c).

  • --specials unconditionally logs "socket not recreated" and returns FILE_SAVE_SKIPPED; create_mode only handles S_IFIFO. Verified mknod(..., S_IFSOCK) succeeds unprivileged, so the "impossible" classification is wrong. RSYNC_COMPAT.md marks --specials as ⛔ (sockets) incorrectly.
  • --copy-devices is parsed into Config and copied to ScannerOptions but never read; the scanner's scanner_prepare_special ignores it, so the flag has no effect.

Fix: handle S_IFSOCK in the special-node path (keeping EEXIST/EPERM skip behavior); wire copy_devices into the scanner decision (copy device content to a regular file when requested; otherwise skip non-regular entries like rsync by default). Update doc status.

Audit findings (`src/shared/file_receive.c`, `src/client/scanner.c`). - `--specials` unconditionally logs "socket not recreated" and returns FILE_SAVE_SKIPPED; `create_mode` only handles S_IFIFO. Verified `mknod(..., S_IFSOCK)` succeeds unprivileged, so the "impossible" classification is wrong. RSYNC_COMPAT.md marks `--specials` as ⛔ (sockets) incorrectly. - `--copy-devices` is parsed into Config and copied to ScannerOptions but never read; the scanner's `scanner_prepare_special` ignores it, so the flag has no effect. Fix: handle `S_IFSOCK` in the special-node path (keeping EEXIST/EPERM skip behavior); wire `copy_devices` into the scanner decision (copy device content to a regular file when requested; otherwise skip non-regular entries like rsync by default). Update doc status.
TapTap added the needs-triage label 2026-09-15 19:33:33 +02:00
Author
Owner

Fixed. --specials now recreates S_IFSOCK sockets via mknodat(S_IFSOCK) (unprivileged), keeping EEXIST/EPERM skip semantics; --copy-devices is wired into the scanner so a device is sent as a regular file. --copy-devices remains a documented bounded safe divergence. Closing as completed.

Fixed. `--specials` now recreates `S_IFSOCK` sockets via `mknodat(S_IFSOCK)` (unprivileged), keeping EEXIST/EPERM skip semantics; `--copy-devices` is wired into the scanner so a device is sent as a regular file. `--copy-devices` remains a documented bounded safe divergence. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#288