nautd: block adding a torrent that would overlap existing data

spawn_torrent parses each torrent's file list (at add and restore) and
refuses an add whose files would write where a registered torrent's data
lives (NAUT_ERR_EXIST). Magnets are checked once metadata is known is
out of scope; restore skips the check. webui surfaces it as HTTP 409.
Mark #10 done.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ookami125 2026-06-22 01:01:50 -04:00
parent 187e8f2db2
commit 7bbc1ee22c
5 changed files with 149 additions and 8 deletions

View file

@ -52,6 +52,7 @@ enum {
NAUT_ERR_FULL = -8,
NAUT_ERR_EMPTY = -9,
NAUT_ERR_NOTFOUND = -10,
NAUT_ERR_EXIST = -11, /* already exists / data would overlap */
};
const char *naut_strerror(naut_err e);